fill

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

Return a tensor filled with the scalar value.

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

dragon.Tensor – The output tensor.