Skip to content
fn

assign_inplace_op

→TensorImplPtr
int assign_inplace_op(const int & a, const int & value, const int & name)

Writes value into a in place, the way the ops above take their own results: into a's buffer (TensorImpl::write_through), then into value's place in the autograd graph, or out of it when value has none. For a tensor with live views, whose values have to land where the views read them.

Parameters

aTensorImplPtr
A dense CPU tensor with live views.
valueTensorImplPtr
The new contents; same shape and dtype as a.
namestd::string
Op name for error messages.

Returns

TensorImplPtr

The same pointer as a.