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
Certain operations (specifically basic shape manipulations - reshape, transpose, permute, etc.) are commonly used as methods of tensors in other frameworks (Torch, Numpy, Jax, etc.) and often "chained" together, e.g. tensor2 = tensor1.method1(args1).method2(args2).method3(args3). Adding these as methods of tensors improves code readability significantly when used in this way, as we've seen when translating demos from Torch to Tripy (the current approach requires tensor2 = tp.method3(tp.method2(tp.method1(tensor1, args1), args2), args3) to write on one line).
We should add such methods as methods of tensors, however, we only want to do this for a few methods where it "makes sense" and not create too many ways to do the same thing for every operation. Some approaches to evaluate this:
Check what NumPy / JAX support as methods of tensors
Check demos and see what patterns are commonly using a "chain" of methods on a tensor (i.e. are commonly paired with other related funcs)
Gut check if it "makes sense" - would you think to call tensor1.ReLU() or tp.ReLU(tensor1)? Assume users read left to right.
The text was updated successfully, but these errors were encountered:
Certain operations (specifically basic shape manipulations - reshape, transpose, permute, etc.) are commonly used as methods of tensors in other frameworks (Torch, Numpy, Jax, etc.) and often "chained" together, e.g.
tensor2 = tensor1.method1(args1).method2(args2).method3(args3)
. Adding these as methods of tensors improves code readability significantly when used in this way, as we've seen when translating demos from Torch to Tripy (the current approach requirestensor2 = tp.method3(tp.method2(tp.method1(tensor1, args1), args2), args3)
to write on one line).We should add such methods as methods of tensors, however, we only want to do this for a few methods where it "makes sense" and not create too many ways to do the same thing for every operation. Some approaches to evaluate this:
tensor1.ReLU()
ortp.ReLU(tensor1
)? Assume users read left to right.The text was updated successfully, but these errors were encountered: