Skip to content
fn

zeros_op

→TensorImplPtr
int zeros_op(const int & shape, Dtype dt, Device device, bool requires_grad)

Python wrappers

Public Python APIs implemented by this engine symbol.

Create a tensor of the given shape filled with zeros.

See Also

zeros_like_op : Shape-inheriting variant.

Parameters

shapeShape
Desired output shape.
dtDtype
Element dtype.
deviceDevice
Target device.
requires_gradbool
Attach a fresh autograd leaf when true.

Returns

TensorImplPtr

Leaf tensor of the specified shape, dtype, and device.