Ones

class dragon.vm.tensorlayer.initializers.Ones[source]

Fill tensor with ones.

\[\text{tensor} \leftarrow 1 \]

__init__

Ones.__init__()[source]

Create a Ones initializer.

Methods

__call__

Initializer.__call__(
  shape,
  dtype='float32',
  **kwargs
)[source]

Return a tensor initialized as specified initializer.

Parameters:
  • shape (Sequence[int]) – The shape of the tensor.
  • dtype (str, optional, default='float32') – The optional data type.
Returns:

dragon.Tensor – The output tensor.