Skip to content
fn

square_op

→TensorImplPtr
int square_op(const int & a)

Python wrappers

Public Python APIs implemented by this engine symbol.

Compute y=x2y = x^2 element-wise.

Allocates a fresh output of the same shape and dtype as a and delegates to SquareBackward::forward.

See Also

SquareBackward — backward node.

Parameters

aTensorImplPtr
Input tensor of any shape.

Returns

TensorImplPtr

Output tensor of the same shape and dtype.