Closed dfalbel closed 5 years ago
Sorry for comment on the closed issue, but have you considered overriding base
functions with generics and setting base
functions as default methods ?
This approach would not be a bad option because it is suggested in the Writing R Extensions manual.
Thanks @nakamichiworks ! I have considered this. The problem is that when loading the package there would be a long list of:
The following objects are masked from ‘package:base’:
atan2, fun2 ,fun3,
Also I think it's nice to have a prefix to help find all methods faster.
I understand the tradeoff and your decision. Thanks.
I'm really excited about the possibility for R users to have a native interface to pytorch. Keep up the great work !
At this moment I am writing all tensor methods as S3 methods. The problem with this approach is that not all names can be used as S3 methods.
For example
atan2
is not a generic in base.I am wondering if it would be better to write everything like:
torch_sum
torch_mean
torch_atan
It's more verbose, but maybe make clearer that we are dealing with torch tensors and removes the problem of s3 methods.