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
So first we should clarify if we want this or not.
Then on the technical question how to do it:
I think PyCharm do this automatically on-the-fly when the module is loaded. But I think they provide (auto-generated) pyi files such that autocompletion works with PyCharm etc.
We could also load it on-the-fly. But when we auto-generate pyi files, I think instead we could directly auto-generate some automatic tensor mixin type or so, and then have it more direct.
Or we could explicitly/manually add all the functions. Currently we already do that manually for all the base arithmetic functions like __add__ etc.
The text was updated successfully, but these errors were encountered:
PyTorch provides all tensor functions also on the
Tensor
type itself, doc.This includes:
abs
,tanh
,log_softmax
, etc)sum
(likereduce_sum
in TF, or ourreduce
)matmul
, etctranspose
,reshape
, etcTF does not do this. However, it can often lead to easier code (in my opinion). Examples:
indices.gather(axis=k_dim, position=i)
indices.range_in_axis(axis=k_dim)
x.length(axis=spatial_dim)
num.reduce(mode="max", axis=num.shape_ordered)
(a - b).abs().reduce(mode="mean", axis=axis)
data.length(axis=time_dim).reduce(mode="max", axis=nn.batch_dim)
So first we should clarify if we want this or not.
Then on the technical question how to do it:
I think PyCharm do this automatically on-the-fly when the module is loaded. But I think they provide (auto-generated)
pyi
files such that autocompletion works with PyCharm etc.We could also load it on-the-fly. But when we auto-generate pyi files, I think instead we could directly auto-generate some automatic tensor mixin type or so, and then have it more direct.
Or we could explicitly/manually add all the functions. Currently we already do that manually for all the base arithmetic functions like
__add__
etc.The text was updated successfully, but these errors were encountered: