Skip to content
fn

neg_op

→TensorImplPtr
int neg_op(const int & a)

Python wrappers

Public Python APIs implemented by this engine symbol.

Compute y=−xy = -x element-wise.

Allocates a fresh output of the same shape and dtype as a and routes the forward pass through NegBackward, which also installs the autograd edge.

See Also

NegBackward — backward node.

Parameters

aTensorImplPtr
Input tensor of any shape.

Returns

TensorImplPtr

Output tensor of the same shape and dtype.