@@ -423,7 +423,7 @@ def constraints_example4(x, y):
423
423
exported_constraints_example4 = export (constraints_example4 , (torch .randn (3 , 3 ), torch .tensor ([4 ])))
424
424
print (exported_constraints_example4 (torch .randn (3 , 3 ), torch .tensor ([5 ])))
425
425
try :
426
- exported_constraints_example4 (torch .randn (3 , 3 ), torch .randn ([2 ]))
426
+ exported_constraints_example4 (torch .randn (3 , 3 ), torch .tensor ([2 ]))
427
427
except Exception :
428
428
tb .print_exc ()
429
429
@@ -441,7 +441,7 @@ def constraints_example5(x, y):
441
441
exported_constraints_example5 = export (constraints_example5 , (torch .randn (2 , 2 ), torch .tensor ([4 ])))
442
442
print (exported_constraints_example5 (torch .randn (2 , 2 ), torch .tensor ([5 ])))
443
443
try :
444
- exported_constraints_example5 (torch .randn (2 , 2 ), torch .randn ([1 ]))
444
+ exported_constraints_example5 (torch .randn (2 , 2 ), torch .tensor ([1 ]))
445
445
except Exception :
446
446
tb .print_exc ()
447
447
@@ -496,6 +496,10 @@ def custom_op_example(x):
496
496
# Note in the above outputs that the custom op is included in the exported graph.
497
497
# And when we call the exported graph as a function, the original custom op is called,
498
498
# as evidenced by the ``print`` call.
499
+ #
500
+ # If you have a custom operator implemented in C++, please refer to
501
+ # `this document <https://docs.google.com/document/d/1_W62p8WJOQQUzPsJYa7s701JXt0qf2OfLub2sbkHOaU/edit#heading=h.ahugy69p2jmz>`__
502
+ # to make it compatible with ``torch.export``.
499
503
500
504
######################################################################
501
505
# ExportDB
0 commit comments