fill

dragon.fill(
  shape,
  value=0,
  dtype=None,
  **kwargs
)[source]

Return a tensor filled with the specific value.

\[y \leftarrow \text{value} \]
Parameters:
  • shape (Sequence[Union[int, dragon.Tensor]]) – The shape of the tensor.
  • value (number, optional, default=0) – The value to fill.
  • dtype (str, optional, default='float32') – The optional data type.
Returns:

dragon.Tensor – The output tensor.