Skip to content

Commit e01fb89

Browse files
author
Sidney Zhang
committed
add custom types
1 parent 96c0537 commit e01fb89

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

advanced_source/torch_script_custom_ops.rst

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,3 +1076,34 @@ visible to TorchScript:
10761076
>>> torch.ops.load_library("warp_perspective.so")
10771077
>>> print(torch.ops.custom.warp_perspective)
10781078
<built-in method custom::warp_perspective of PyCapsule object at 0x7ff51c5b7bd0>
1079+
1080+
1081+
FAQ
1082+
---------------------------------------
1083+
1084+
1085+
Custom Ops Types
1086+
*******************
1087+
1088+
TorchScript custom Ops supports a limited number of types. The types supported by JIT custom ops are declared `here<https://github.com/pytorch/pytorch/blob/master/aten/src/ATen/core/jit_type.h>`_.
1089+
1090+
Currently, the types that are supported are:
1091+
1092+
- torch::Tensor
1093+
- at::Scalar
1094+
1095+
This represents the python number
1096+
1097+
- double
1098+
1099+
Note that float is not currently supported.
1100+
1101+
- int64_t
1102+
1103+
Note that int is not currently supported.
1104+
1105+
- bool
1106+
- string
1107+
- std::vector<torch::Tensor>
1108+
- std::vector<double>
1109+
- std::vector<int64_t>

0 commit comments

Comments
 (0)