Ones

class dragon.vm.tensorflow.keras.initializers.Ones(dtype='float32')[source]

Fill tensors with ones.

__init__

Ones.__init__(dtype='float32')[source]

Create a Ones initializer.

Parameters:
  • dtype (str, optional, default='float32') – The data type to set as default.

Methods

__call__

Ones.__call__(
  shape,
  dtype=None,
  **kwargs
)[source]

Return a tensor initialized from the initializer.

Parameters:
  • shape (Sequence[int]) – The tensor shape.
  • dtype (str, optional) – The optional data type.
Returns:

dragon.Tensor – The output tensor.