Constant

class dragon.vm.tensorlayer.initializers.Constant(value=0)[source]

Fill tensor with a scalar value.

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

__init__

Constant.__init__(value=0)[source]

Create a Constant initializer.

Parameters:
  • value (number, optional, default=0.) – The value fo fill.

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.