@@ -283,31 +283,6 @@ def call_operator(self, op, args, kwargs, meta):
283
283
return super ().call_operator (op , args , kwargs , meta )
284
284
285
285
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
-
311
286
@register_cadence_pass (CadencePassAttribute (opt_level = 0 ))
312
287
class ReplaceMMWithAddMMPass (ExportPass ):
313
288
"""
@@ -2407,7 +2382,6 @@ class CadenceReplaceOpsInGraph:
2407
2382
passes = [
2408
2383
ReplaceEmptyTensorsWithFullPass ,
2409
2384
ReplaceFunctionallyEquivalentOpTargets ,
2410
- ReplaceTCopyWithTransposePass ,
2411
2385
ReplacePermuteWithTransposePass ,
2412
2386
ReplaceScalarWithTensorArgPass ,
2413
2387
ReplaceConvolutionOptionalArgsWithConcreteArgsPass ,
0 commit comments