Ones

public class Ones

Initializer that generates tensors initialized to 1.

Examples:

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

Public Constructors

Ones(Ops tf)
Creates an Initializer that sets all values to one.

Public Methods

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

Inherited Methods

Public Constructors

public Ones (Ops tf)

Creates an Initializer that sets all values to one.

Examples:

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

Parameters
tf the TensorFlow Ops

Public Methods

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