Skip to content

Commit 4779db8

Browse files
authored
Merge pull request pytorch#388 from sidazhang/type_notes
Add notes about supported custom ops input types
2 parents 96c0537 + e01fb89 commit 4779db8

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

advanced_source/torch_script_custom_ops.rst

+31
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)