@@ -283,31 +283,6 @@ def call_operator(self, op, args, kwargs, meta):
283283 return super ().call_operator (op , args , kwargs , meta )
284284
285285
286- @register_cadence_pass (CadencePassAttribute (opt_level = 0 ))
287- class ReplaceTCopyWithTransposePass (ExportPass ):
288- """
289- Replace t_copy with transpose_copy.int. If the input is 1D, the t_copy is
290- a nop. t_copy is not supported, so this is an opt_level=0 pass.
291- """
292-
293- def call_operator (self , op , args , kwargs , meta ):
294- if get_edge_overload_packet (op ) != exir_ops .edge .aten .t_copy :
295- return super ().call_operator (op , args , kwargs , meta )
296-
297- # Get the input tensor shape
298- in_tensor = args [0 ].to_tensor () if isinstance (args [0 ], ProxyValue ) else args [0 ]
299-
300- # If the input is a 1D tensor, this t_copy is a nop, so return the input
301- if in_tensor .dim () <= 1 :
302- return args [0 ]
303-
304- assert in_tensor .dim () == 2 , "t_copy expects a tensor with <= 2 dimensions"
305- transpose_args = (args [0 ], 0 , 1 )
306- return super ().call_operator (
307- exir_ops .edge .aten .transpose_copy .int , transpose_args , kwargs , meta
308- )
309-
310-
311286@register_cadence_pass (CadencePassAttribute (opt_level = 0 ))
312287class ReplaceMMWithAddMMPass (ExportPass ):
313288 """
@@ -2407,7 +2382,6 @@ class CadenceReplaceOpsInGraph:
24072382 passes = [
24082383 ReplaceEmptyTensorsWithFullPass ,
24092384 ReplaceFunctionallyEquivalentOpTargets ,
2410- ReplaceTCopyWithTransposePass ,
24112385 ReplacePermuteWithTransposePass ,
24122386 ReplaceScalarWithTensorArgPass ,
24132387 ReplaceConvolutionOptionalArgsWithConcreteArgsPass ,
0 commit comments