Allocates device-side cache for this Tensor, and returns a java.lang.AutoCloseable to release the cache.
Allocates device-side cache for this Tensor, and returns a java.lang.AutoCloseable to release the cache.
This method can be called multiple times on one Tensor. Only one copy of cache will be allocated, which will be finally released until all java.lang.AutoCloseable returned by cache method are closed.
Allocates device-side cache that are managed by the RAII.scala library.
Allocates device-side cache that are managed by the RAII.scala library.
This method is similar to cache, except the life cycle of the cache can be automatically managed.
Returns an asynchronous task to read this Tensor into a scala.Array, which is linearized in row-majoy order.
Returns an asynchronous task to read this Tensor into a scala.Array, which is linearized in row-majoy order.
Returns a RAII managed asynchronous task to read this Tensor into an off-heap memory, which is linearized in row-majoy order.
Returns a new Tensor of new shape and the same data of this Tensor.
The data in this Tensor is considered as row-major order when reshape. You can create another column-major version reshape by reversing the shape:
def columnMajorReshape[Category <: Tensors](tensor: Category#Tensor, newShape: Array[Int]): Category#Tensor = { tensor.permute(tensor.shape.indices.reverse.toArray).reshape(newShape.reverse).permute(newShape.indices.reverse.toArray) }
(nonInlineTensor: any2stringadd[NonInlineTensor]).+(other)
Methods that provides general information of this Tensor.
Actions that can actually perform delayed operations in order to read the data from the device to JVM, or change the internal state of this Tensor.
Operators that return new Tensors of delay-evaluated computational graphs. The actually computation will be only performed when Slow actions are called.