Skip to content
fn

full_op

→TensorImplPtr
int full_op(const int & shape, double fill_value, 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 a constant scalar.

Parameters

shapeShape
Desired output shape.
fill_valuedouble
Scalar value cast to dt before filling.
dtDtype
Element dtype.
deviceDevice
Target device.
requires_gradbool
Attach a fresh autograd leaf when true.

Returns

TensorImplPtr

Leaf tensor whose every element equals fill_value (cast).