Packages

sealed trait Tensor extends AnyRef

Self Type
Tensor
Source
Tensors.scala
Note

There are three kinds of Tensor.

  • InlineTensor and TransformedTensor are like a @inline def, which can be merged into a larger kernel and will be recalculated whenever a slow action is performed.
  • NonInlineTensor is like a @noinline def, which is never merged into a larger kernel and will be recalculated whenever a slow action is performed.
  • CachedTensor is like a 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.
Linear Supertypes
Type Hierarchy
Ordering
  1. Grouped
  2. Alphabetic
  3. By Inheritance
Inherited
  1. Tensor
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract val closure: (trees)#FloatTerm
    Attributes
    protected
  2. abstract def nonInline: NonInlineTensor

  3. abstract def padding: Float

  4. abstract def shape: Array[Int]

    Returns the sizes of each dimension of this Tensor.

    Returns the sizes of each dimension of this Tensor.

    Note

    The returned array should be considered as immutable. Changing the array is an undefined behavior.

    ,

    The return value will be Array.empty if this Tensor is a scalar.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def %(rightHandSide: Tensor): InlineTensor

  4. def *(rightHandSide: Tensor): InlineTensor

  5. def +(rightHandSide: Tensor): InlineTensor

  6. def -(rightHandSide: Tensor): InlineTensor

  7. def ->[B](y: B): (Tensor, B)
    Implicit
    This member is added by an implicit conversion from Tensor to ArrowAssoc[Tensor] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  8. def /(rightHandSide: Tensor): InlineTensor

  9. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  10. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  11. def broadcast(newShape: Array[Int]): Tensor

  12. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  13. def doCache: Do[CachedTensor]

    Allocates device-side cache that are managed by the RAII.scala library.

  14. def ensuring(cond: (Tensor) ⇒ Boolean, msg: ⇒ Any): Tensor
    Implicit
    This member is added by an implicit conversion from Tensor to Ensuring[Tensor] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  15. def ensuring(cond: (Tensor) ⇒ Boolean): Tensor
    Implicit
    This member is added by an implicit conversion from Tensor to Ensuring[Tensor] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  16. def ensuring(cond: Boolean, msg: ⇒ Any): Tensor
    Implicit
    This member is added by an implicit conversion from Tensor to Ensuring[Tensor] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  17. def ensuring(cond: Boolean): Tensor
    Implicit
    This member is added by an implicit conversion from Tensor to Ensuring[Tensor] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  18. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  20. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  21. def flatArray: Future[Array[Trees.FloatTrees.FloatTerm.JvmValue]]

    Returns an asynchronous task to read this Tensor into a scala.Array, which is linearized in row-major order.

  22. def flatBuffer: Do[FloatBuffer]

    Returns a RAII managed asynchronous task to read this Tensor into an off-heap memory, which is linearized in row-major order.

  23. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from Tensor to StringFormat[Tensor] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  24. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  25. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  26. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  27. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  28. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  29. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  30. def permute(dimensions: Array[Int]): TransformedTensor

  31. def read1DArray: Future[Array[Float]]

    Returns an asynchronous task to read this Tensor into a scala.Array

  32. def read1DSeq: Future[Seq[Float]]

    Returns an asynchronous task to read this Tensor into a scala.Seq

  33. def read2DArray: Future[Array[Array[Float]]]

    Returns an asynchronous task to read this Tensor into a 2D scala.Array

  34. def read2DSeq: Future[Seq[Seq[Float]]]

    Returns an asynchronous task to read this Tensor into a 2D scala.Seq

  35. def read3DArray: Future[Array[Array[Array[Float]]]]

    Returns an asynchronous task to read this Tensor into a 3D scala.Array

  36. def read3DSeq: Future[Seq[Seq[Seq[Float]]]]

    Returns an asynchronous task to read this Tensor into a 3D scala.Seq

  37. def read4DArray: Future[Array[Array[Array[Array[Float]]]]]

    Returns an asynchronous task to read this Tensor into a 4D scala.Array

  38. def read4DSeq: Future[Seq[Seq[Seq[Seq[Float]]]]]

    Returns an asynchronous task to read this Tensor into a 4D scala.Seq

  39. def read5DArray: Future[Array[Array[Array[Array[Array[Float]]]]]]

    Returns an asynchronous task to read this Tensor into a 5D scala.Array

  40. def read5DSeq: Future[Seq[Seq[Seq[Seq[Seq[Float]]]]]]

    Returns an asynchronous task to read this Tensor into a 5D scala.Seq

  41. def readScalar: Future[Float]

    Returns an asynchronous task to read this Tensor into a scala.Float

  42. def reshape(newShape: Array[Int]): NonInlineTensor

    Returns a new Tensor of new shape and the same data of this Tensor.

    Returns a new Tensor of new shape and the same data of this Tensor.

    Note

    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)
    }
  43. def scale(newShape: Array[Int]): TransformedTensor

  44. def split(dimension: Int): IndexedSeq[TransformedTensor]

  45. def sum: NonInlineTensor

  46. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  47. def toString(): String

    Definition Classes
    Tensor → AnyRef → Any
  48. def translate(offset: Array[Double], newShape: Array[Int] = shape): TransformedTensor

  49. def transpose: TransformedTensor

  50. def unary_+: Tensor.this.type

  51. def unary_-: InlineTensor

  52. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  53. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  54. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  55. def [B](y: B): (Tensor, B)
    Implicit
    This member is added by an implicit conversion from Tensor to ArrowAssoc[Tensor] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Shadowed Implicit Value Members

  1. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from Tensor to any2stringadd[Tensor] performed by method any2stringadd in scala.Predef.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (tensor: any2stringadd[Tensor]).+(other)
    Definition Classes
    any2stringadd

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from Tensor to any2stringadd[Tensor]

Inherited by implicit conversion StringFormat from Tensor to StringFormat[Tensor]

Inherited by implicit conversion Ensuring from Tensor to Ensuring[Tensor]

Inherited by implicit conversion ArrowAssoc from Tensor to ArrowAssoc[Tensor]

General information

Methods that provides general information of this Tensor.

Slow actions

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.

Delayed operators

Operators that return new Tensors of delay-evaluated computational graphs. The actually computation will be only performed when Slow actions are called.

Ungrouped