eazygrad.ones

eazygrad.ones(*shape: int, requires_grad: bool = False, dtype: Any = numpy.float32) _Tensor[source]

Return a tensor filled with ones.

Parameters:
  • *shape (int) – Output shape.

  • requires_grad (bool, default=False) – Whether to track gradients for the returned tensor.

  • dtype (numpy.dtype or type, default=numpy.float32) – Output dtype.

Returns:

_Tensor – Tensor filled with ones.

See also

torch.ones