Rate this Page

Function torch ::stable::zero_#

Function Documentation#

inline torch::stable::Tensor torch::stable::zero_(torch::stable::Tensor &self)#

Stable version of the zero_ op.

Fills the input tensor with zeros in-place and returns it. Unlike the tensor method version (t.zero_()), this is called as a function: zero_(t).

Minimum compatible version: PyTorch 2.9.

Parameters:

self – The tensor to fill with zeros.

Returns:

The input tensor, now filled with zeros.