Constant

public class Constant

Initializer that generates tensors with a constant value.

Examples:

      Constant<TFloat32> initializer =
              new org.tensorflow.framework.initializers.Constant<>(tf, 3f);
      Operand<TFloat32> values =
              initializer.call(tf.constant(Shape.of(2,2)), TFloat32.class);
 

Public Constructors

Constant(Ops tf, long value)
Creates an Initializer that generates tensors with a constant value.
Constant(Ops tf, double value)
Creates an Initializer that generates tensors with a constant value.
Constant(Ops tf, boolean value)
Creates an Initializer that generates tensors with a constant value.

Public Methods

Operand<T>
call(Operand<TInt64> dims, Class<T> type)

Inherited Methods

org.tensorflow.framework.initializers.BaseInitializer
Ops
getTF()
Gets the TensorFlow Ops
boolean
equals(Object arg0)
final Class<?>
getClass()
int
hashCode()
final void
notify()
final void
notifyAll()
String
toString()
final void
wait(long arg0, int arg1)
final void
wait(long arg0)
final void
wait()
org.tensorflow.framework.initializers.Initializer
abstract Operand<T>
call(Operand<TInt64> dims, Class<T> type)
Generates the operation used to perform the initialization.

Public Constructors

public Constant (Ops tf, long value)

Creates an Initializer that generates tensors with a constant value.

Parameters
tf the TensorFlow Ops
value a long value used for the constant.

public Constant (Ops tf, double value)

Creates an Initializer that generates tensors with a constant value.

Parameters
tf the TensorFlow Ops
value a double value used for the constant.

public Constant (Ops tf, boolean value)

Creates an Initializer that generates tensors with a constant value.

Parameters
tf the TensorFlow Ops
value a boolean value used for the constant.

Public Methods

public Operand<T> call (Operand<TInt64> dims, Class<T> type)