Are you an EPFL student looking for a semester project?
Work with us on data science and visualisation projects, and deploy your project as an app on top of Graph Search.
a = torch.randn(3,4) =a 0.2381 -0.3401 -1.7844 -0.2615 0.1411 1.6249 0.1708 0.8299 1.0434 2.2291 1.0525 0.8465 [torch.DoubleTensor of dimension 3x4] a[1][2] 0.34010116549482 a:narrow(1,1,2) 0.2381 -0.3401 -1.7844 -0.2615 0.1411 1.6249 0.1708 0.8299 [torch.DoubleTensor of dimension 2x4] a:index(1, torch.LongTensor{1,2}) 0.2381 -0.3401 -1.7844 -0.2615 0.1411 1.6249 0.1708 0.8299 [torch.DoubleTensor of dimension 2x4] a:min() 1.7844365427828 The torch package also simplifies object-oriented programming and serialization by providing various convenience functions which are used throughout its packages. The torch.class(classname, parentclass) function can be used to create object factories (classes). When the constructor is called, torch initializes and sets a Lua table with the user-defined metatable, which makes the table an object. Objects created with the torch factory can also be serialized, as long as they do not contain references to objects that cannot be serialized, such as Lua coroutines, and Lua userdata. However, userdata can be serialized if it is wrapped by a table (or metatable) that provides read() and write() methods.
Rachid Guerraoui, Nirupam Gupta, Rafaël Benjamin Pinot