Class DenseNdArray<T>

java.lang.Object
org.tensorflow.ndarray.impl.dense.AbstractDenseNdArray<T, NdArray<T>>
org.tensorflow.ndarray.impl.dense.DenseNdArray<T>
All Implemented Interfaces:
NdArray<T>, Shaped

public class DenseNdArray<T> extends AbstractDenseNdArray<T, NdArray<T>>
  • Field Details

  • Constructor Details

  • Method Details

    • wrap

      public static <T> NdArray<T> wrap(DataBuffer<T> buffer, Shape shape)
    • copyTo

      public NdArray<T> copyTo(NdArray<T> dst)
      Description copied from interface: NdArray
      Copy the content of this array to the destination array.

      The Shaped.shape() of the destination array must be equal to the shape of this array, or an exception is thrown. After the copy, the content of both arrays can be altered independently, without affecting each other.

      Parameters:
      dst - array to receive a copy of the content of this array
      Returns:
      this array
    • buffer

      protected DataBuffer<T> buffer()
      Specified by:
      buffer in class AbstractDenseNdArray<T, NdArray<T>>
    • dimensions

      public DimensionalSpace dimensions()
    • shape

      public Shape shape()
      Specified by:
      shape in interface Shaped
      Returns:
      the shape of this container
    • scalars

      public NdArraySequence<NdArray<T>> scalars()
      Description copied from interface: NdArray
      Returns a sequence of all scalars in this array.

      This is equivalent to call elements(shape().numDimensions() - 1)

      Specified by:
      scalars in interface NdArray<T>
      Returns:
      an NdArray sequence
    • slowHashCode

      protected int slowHashCode()
    • slowEquals

      protected boolean slowEquals(NdArray<?> array)