Allocates device-side cache that are managed by the RAII.scala library.
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) }
(tensor: any2stringadd[Tensor]).+(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.
There are three kinds of Tensor.
@inline def
, which can be merged into a larger kernel and will be recalculated whenever a slow action is performed.@noinline def
, which is never merged into a larger kernel and will be recalculated whenever a slow action is performed.lazy val
, which has an associated data buffer on the compute device and will be calculated only once even when slow actions are performed more than once.