You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should have a way to specify docstrings on a) custom registered classes and b) the methods thereof. I believe this will entail:
C++ APIs for populating the docstring. I can't find a pybind11 equivalent for installing a docstring on a class, but it could be an extra string argument to the torch::class_<> constructor. For method definitions I think it should similarly be an extra string argument to class_::def()
A way to represent docstrings in the TorchScript type system. For classes, it could preferably be a __doc__ attribute, or a special case method on the ClassType:
Note that for any of these stages, if we can generalize the support to broader TorchScript support (particularly the frontend concerns), that would probably be a good idea
We should have a way to specify docstrings on a) custom registered classes and b) the methods thereof. I believe this will entail:
torch::class_<>
constructor. For method definitions I think it should similarly be an extra string argument toclass_::def()
__doc__
attribute, or a special case method on theClassType
:pytorch/aten/src/ATen/core/jit_type.h
Line 1950 in 40828b6
jit::Function
:pytorch/aten/src/ATen/core/function.h
Line 27 in 40828b6
__doc__
property to access the docstring as we defined in step (2):pytorch/torch/csrc/jit/python/python_custom_class.cpp
Line 31 in 40828b6
__doc__
property on ScriptFunction:pytorch/torch/csrc/jit/python/script_init.cpp
Line 1111 in 40828b6
Note that for any of these stages, if we can generalize the support to broader TorchScript support (particularly the frontend concerns), that would probably be a good idea
cc @gmagogsfm
The text was updated successfully, but these errors were encountered: