Class TfNDManager

java.lang.Object
ai.djl.ndarray.BaseNDManager
ai.djl.tensorflow.engine.TfNDManager
All Implemented Interfaces:
ai.djl.ndarray.NDManager, AutoCloseable

public class TfNDManager extends ai.djl.ndarray.BaseNDManager
  • Nested Class Summary

    Nested classes/interfaces inherited from class ai.djl.ndarray.BaseNDManager

    ai.djl.ndarray.BaseNDManager.TempResource

    Nested classes/interfaces inherited from interface ai.djl.ndarray.NDManager

    ai.djl.ndarray.NDManager.SystemNDManager
  • Field Summary

    Fields inherited from class ai.djl.ndarray.BaseNDManager

    alternativeManager, capped, closed, device, name, parent, resources, tempResources, uid

    Fields inherited from interface ai.djl.ndarray.NDManager

    UID_GENERATOR
  • Method Summary

    Modifier and Type
    Method
    Description
    allocateDirect(int capacity)
    ai.djl.ndarray.NDArray
    arange(float start, float stop, float step, ai.djl.ndarray.types.DataType dataType)
    ai.djl.ndarray.NDArray
    create(ai.djl.ndarray.types.Shape shape, ai.djl.ndarray.types.DataType dataType)
    ai.djl.ndarray.NDArray
    create(String[] data, Charset charset, ai.djl.ndarray.types.Shape shape)
    create(Buffer data, ai.djl.ndarray.types.Shape shape, ai.djl.ndarray.types.DataType dataType)
    ai.djl.ndarray.NDArray
    createStringTensor(ai.djl.ndarray.types.Shape shape, ByteBuffer... data)
    Creates a String NDArray based on the provided shape.
    ai.djl.ndarray.NDArray
    eye(int rows, int cols, int k, ai.djl.ndarray.types.DataType dataType)
    from(ai.djl.ndarray.NDArray array)
    ai.djl.ndarray.NDArray
    full(ai.djl.ndarray.types.Shape shape, float value, ai.djl.ndarray.types.DataType dataType)
    org.tensorflow.internal.c_api.TFE_Context
     
    final ai.djl.engine.Engine
    ai.djl.ndarray.NDArray
    linspace(float start, float stop, int num, boolean endpoint)
    newSubManager(ai.djl.Device device)
    ai.djl.ndarray.NDArray
    ones(ai.djl.ndarray.types.Shape shape, ai.djl.ndarray.types.DataType dataType)
    ai.djl.tensorflow.engine.TfOpExecutor
    opExecutor(String operation)
     
    ai.djl.ndarray.NDArray
    randomNormal(float loc, float scale, ai.djl.ndarray.types.Shape shape, ai.djl.ndarray.types.DataType dataType)
    ai.djl.ndarray.NDArray
    randomUniform(float low, float high, ai.djl.ndarray.types.Shape shape, ai.djl.ndarray.types.DataType dataType)
    ai.djl.ndarray.NDArray
    truncatedNormal(float loc, float scale, ai.djl.ndarray.types.Shape shape, ai.djl.ndarray.types.DataType dataType)
    ai.djl.ndarray.NDArray
    zeros(ai.djl.ndarray.types.Shape shape, ai.djl.ndarray.types.DataType dataType)

    Methods inherited from class ai.djl.ndarray.BaseNDManager

    attachInternal, attachUncappedInternal, cap, close, copyBuffer, createCoo, createCSR, createRowSparse, debugDump, defaultDevice, detachInternal, getDevice, getManagedArrays, getName, getParentManager, invoke, invoke, isOpen, load, newSubManager, randomInteger, randomMultinomial, randomMultinomial, randomPermutation, sampleGamma, sampleGamma, sampleNormal, sampleNormal, samplePoisson, samplePoisson, setName, tempAttachInternal, toString, validateBuffer

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface ai.djl.ndarray.NDManager

    arange, arange, arange, arange, arange, arange, arange, arange, attachAll, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, createCSR, createCSR, createRowSparse, decode, decode, eye, eye, eye, eye, full, full, full, hanningWindow, linspace, linspace, linspace, linspace, load, ones, ones, randomNormal, randomNormal, randomNormal, randomUniform, randomUniform, ret, tempAttachAll, truncatedNormal, truncatedNormal, truncatedNormal, zeros, zeros
  • Method Details

    • allocateDirect

      public ByteBuffer allocateDirect(int capacity)
    • from

      public TfNDArray from(ai.djl.ndarray.NDArray array)
    • create

      public ai.djl.ndarray.NDArray create(ai.djl.ndarray.types.Shape shape, ai.djl.ndarray.types.DataType dataType)
      Specified by:
      create in interface ai.djl.ndarray.NDManager
      Overrides:
      create in class ai.djl.ndarray.BaseNDManager
    • create

      public TfNDArray create(Buffer data, ai.djl.ndarray.types.Shape shape, ai.djl.ndarray.types.DataType dataType)
    • create

      public ai.djl.ndarray.NDArray create(String[] data, Charset charset, ai.djl.ndarray.types.Shape shape)
      Specified by:
      create in interface ai.djl.ndarray.NDManager
      Overrides:
      create in class ai.djl.ndarray.BaseNDManager
    • createStringTensor

      public ai.djl.ndarray.NDArray createStringTensor(ai.djl.ndarray.types.Shape shape, ByteBuffer... data)
      Creates a String NDArray based on the provided shape.
      Parameters:
      shape - the shape of the String NDArray
      data - the flattened String array
      Returns:
      a new instance of NDArray
    • getEngine

      public final ai.djl.engine.Engine getEngine()
    • zeros

      public ai.djl.ndarray.NDArray zeros(ai.djl.ndarray.types.Shape shape, ai.djl.ndarray.types.DataType dataType)
    • ones

      public ai.djl.ndarray.NDArray ones(ai.djl.ndarray.types.Shape shape, ai.djl.ndarray.types.DataType dataType)
    • full

      public ai.djl.ndarray.NDArray full(ai.djl.ndarray.types.Shape shape, float value, ai.djl.ndarray.types.DataType dataType)
      Specified by:
      full in interface ai.djl.ndarray.NDManager
      Overrides:
      full in class ai.djl.ndarray.BaseNDManager
    • arange

      public ai.djl.ndarray.NDArray arange(float start, float stop, float step, ai.djl.ndarray.types.DataType dataType)
      Specified by:
      arange in interface ai.djl.ndarray.NDManager
      Overrides:
      arange in class ai.djl.ndarray.BaseNDManager
    • eye

      public ai.djl.ndarray.NDArray eye(int rows, int cols, int k, ai.djl.ndarray.types.DataType dataType)
      Specified by:
      eye in interface ai.djl.ndarray.NDManager
      Overrides:
      eye in class ai.djl.ndarray.BaseNDManager
    • linspace

      public ai.djl.ndarray.NDArray linspace(float start, float stop, int num, boolean endpoint)
      Specified by:
      linspace in interface ai.djl.ndarray.NDManager
      Overrides:
      linspace in class ai.djl.ndarray.BaseNDManager
    • randomUniform

      public ai.djl.ndarray.NDArray randomUniform(float low, float high, ai.djl.ndarray.types.Shape shape, ai.djl.ndarray.types.DataType dataType)
      Specified by:
      randomUniform in interface ai.djl.ndarray.NDManager
      Overrides:
      randomUniform in class ai.djl.ndarray.BaseNDManager
    • randomNormal

      public ai.djl.ndarray.NDArray randomNormal(float loc, float scale, ai.djl.ndarray.types.Shape shape, ai.djl.ndarray.types.DataType dataType)
      Specified by:
      randomNormal in interface ai.djl.ndarray.NDManager
      Overrides:
      randomNormal in class ai.djl.ndarray.BaseNDManager
    • truncatedNormal

      public ai.djl.ndarray.NDArray truncatedNormal(float loc, float scale, ai.djl.ndarray.types.Shape shape, ai.djl.ndarray.types.DataType dataType)
      Specified by:
      truncatedNormal in interface ai.djl.ndarray.NDManager
      Overrides:
      truncatedNormal in class ai.djl.ndarray.BaseNDManager
    • newSubManager

      public TfNDManager newSubManager(ai.djl.Device device)
    • getEagerSession

      public org.tensorflow.internal.c_api.TFE_Context getEagerSession()
    • opExecutor

      public ai.djl.tensorflow.engine.TfOpExecutor opExecutor(String operation)