Coder Social home page Coder Social logo

Comments (4)

dfalbel avatar dfalbel commented on May 15, 2024 1

IMHO we should closely follow python here. Ie if a method exists in Python it should also exist in R.

x$t() exists in R the side:

> x <- torch_randn(10, 5)
> x$t()
torch_tensor 
 1.5990 -1.2676  1.4600 -0.6393 -0.8593  1.0309  0.4477  1.0159  0.0463  0.0362
 2.1157  0.7238  0.0673  0.7179  0.1117 -1.0217 -2.2464  0.0867  1.2638 -0.7934
-1.2125 -1.0230 -0.0952 -1.1130  0.2201 -0.3773  0.5066 -0.8243 -0.3650 -0.2140
-0.2426  0.0644  0.2774 -0.9705  1.0606 -1.2880  0.8776 -0.4154  0.1012 -1.9847
-0.6819 -0.0620 -1.3663 -1.2802  0.7495 -0.3198 -1.4872 -0.9426  1.0952  0.2087
[ CPUFloatType{5,10} ]

clone is a special case, because it was not possible to add a clone method to an R6 class.
so we renamed it to copy. We should be able to call it clone again, since we are no longer using R6 classes for tensors.

from torch.

skeydan avatar skeydan commented on May 15, 2024

Oh, I completely agree! Perfect. Yes, then it'd be nice to have a clone as well!

Why I thought there was no x$t():

t$mm_(t$t())
Error: attempt to apply non-function

(but tbh I didn't investigate)

from torch.

dfalbel avatar dfalbel commented on May 15, 2024

I think in this case, mm_ is the one that doesn't exist.

from torch.

skeydan avatar skeydan commented on May 15, 2024

oh, right - it really does not exist (in Python) :-)

Closing this and opening a separate one for clone :-)

from torch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.