Class/Object

com.stripe.agate.tensor

Tensor

Related Docs: object Tensor | package tensor

Permalink

abstract class Tensor[D <: DataType] extends AnyRef

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Tensor
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Tensor()

    Permalink

Abstract Value Members

  1. abstract val dataType: D

    Permalink
  2. abstract def dims: Dims

    Permalink
  3. abstract def storage: Storage[D.Elem]

    Permalink

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def apply(coords: Coords): D.Elem

    Permalink
  5. def asDataTyped: Tensor[dataType.type]

    Permalink

    This replaces the type parameter with dataType.type this is useful in some cases where we have lost track of the type of D

  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def assertDataType(dt: DataType): Try[Tensor[dt.type]]

    Permalink
  8. def axes: Axes

    Permalink
  9. def axesString: String

    Permalink
  10. def broadcastTo(axes: Axes): Try[Tensor[dataType.type]]

    Permalink
  11. def cast(dest: DataType): Tensor[dest.type]

    Permalink
  12. def chunk(axis: Long, size: Long): Try[Seq[Tensor[dataType.type]]]

    Permalink
  13. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  14. def closeTo(that: Tensor[dataType.type], error: Float = 1e-5f): Boolean

    Permalink
  15. def convertDataToAxes: Try[Axes]

    Permalink

    convert this tensor to a Shape.

    convert this tensor to a Shape. This errors if we don't have a 1-D tensor that can be cast to Int64

    The name is long to avoid confusion with axes, which are the axes of this tensor

  16. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  17. def equals(that: Any): Boolean

    Permalink
    Definition Classes
    Tensor → AnyRef → Any
  18. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. def foldMap(dest: DataType, reduceAxes: List[Long], keepDims: Boolean)(f: (D.Elem) ⇒ Elem, g: (Elem, Elem) ⇒ Elem): Try[Tensor[dest.type]]

    Permalink

    map each element to another type, then use a commutative and associative function to reduce along a set of given dimensions.

    map each element to another type, then use a commutative and associative function to reduce along a set of given dimensions.

    empty axes mean reduce along all axes

  20. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  21. def hashCode(): Int

    Permalink
    Definition Classes
    Tensor → AnyRef → Any
  22. def indices(axis: Long): Iterable[Long]

    Permalink
  23. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  24. def isNumeric: Boolean

    Permalink

    Returns true if this tensor has an OnnxNumber instance available for its data type.

  25. def l1NormTo(that: Tensor[dataType.type]): Double

    Permalink
  26. def map(dest: DataType)(f: (D.Elem) ⇒ Elem): Tensor[dest.type]

    Permalink
  27. def map(f: (D.Elem) ⇒ D.Elem): Tensor[dataType.type]

    Permalink
  28. def max: D.Elem

    Permalink
  29. def maxAxes(axes: Long*): Try[Tensor[dataType.type]]

    Permalink

    Get the maximum values along a given axis.

  30. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  31. def nonZero: Tensor[Int64.type]

    Permalink

    This function computes the set of indices of a tensor for which it is non-zero.

    This function computes the set of indices of a tensor for which it is non-zero. It returns a tensor of shape (rank, #nonzero), where #nonzero is the number of non-zero elements in the tensor, and rank is the rank of the original tensor. In other words each column in the output is the index for which the original tensor has a non-zero value. See https://github.com/onnx/onnx/blob/master/docs/Operators.md#NonZero for ONNX reference

    Interestingly, the pytorch implementation (https://github.com/onnx/onnx/blob/master/docs/Operators.md#NonZero) returns the transpose this.

  32. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  33. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  34. def rank: Int

    Permalink
  35. def reshape(axes: Axes): Try[Tensor[dataType.type]]

    Permalink

    This is equivalent to numpy.reshape(data, axes) the total size is unchanged, this only remaps the addressing of the tensor

  36. def scalar: D.Elem

    Permalink

    When called on a scalar (tensor with zero components), returns a scalar value.

    When called on a scalar (tensor with zero components), returns a scalar value.

    In other cases this method throws an error.

  37. def scalars: Iterator[D.Elem]

    Permalink

    Iterate over all items in row major order

  38. def select(range: List[AxisRange]): Tensor[dataType.type]

    Permalink

    This is like numpy array slicing

  39. def slice(axis: Long, index: Long): Tensor[dataType.type]

    Permalink

    Slice along a given axis taking one of the subtensors along that axis

    Slice along a given axis taking one of the subtensors along that axis

    Note this is not exactly what ONNX calls slice

  40. def slices(axis: Long): Seq[(Long, Tensor[dataType.type])]

    Permalink
  41. def squeeze(axis: Long): Option[Tensor[dataType.type]]

    Permalink
  42. def sum: D.Elem

    Permalink
  43. def sumAxes(axes: Long*): Try[Tensor[dataType.type]]

    Permalink

    same as numpy.sum discards each axis we sum, reducing the rank by that number of inputs

  44. def sumAxesKeep(sumAxes: Long*): Try[Tensor[dataType.type]]

    Permalink

    same as numpy.sum but keep the rank the same: leave 1 sized tensor in the place of the previous summed axis if no axes are given, sum over all axes

  45. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  46. def toDoc: Doc

    Permalink
  47. def toRowMajor: Tensor[dataType.type]

    Permalink

    if the current tensor is not rowmajor, rewrite it to row-major

  48. def toString(): String

    Permalink
    Definition Classes
    Tensor → AnyRef → Any
  49. def transpose(axes: List[Long]): Try[Tensor[dataType.type]]

    Permalink

    Transpose given the permutation list

  50. def transpose(axis1: Long, axis2: Long): Option[Tensor[dataType.type]]

    Permalink
  51. def transposeDefault: Tensor[dataType.type]

    Permalink

    Reverse the dimensions.

    Reverse the dimensions. This is the usual transpose for a matrices

  52. def unsqueeze(axis: Long): Option[Tensor[dataType.type]]

    Permalink
  53. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  54. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  55. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  56. def writeInto(output: WritableStorage[D.Elem], start: Long): Long

    Permalink
  57. def writeIntoStream(os: OutputStream)(implicit tb: ToBytes[D.Elem]): Unit

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped