Skip to content
fn

empty_like_op

→TensorImplPtr
int empty_like_op(const int & a, bool requires_grad)

Python wrappers

Public Python APIs implemented by this engine symbol.

Create an uninitialised tensor matching a in shape, dtype, and device.

Parameters

aTensorImplPtr
Tensor whose metadata is mirrored.
requires_gradbool
Attach a fresh autograd leaf when true.

Returns

TensorImplPtr

New leaf tensor; content must not be relied upon (see empty_op).