SyTen

◆ get_and_renew_autodiff()

STensor::AutodiffRenewReturn syten::STensorImpl::STensor::get_and_renew_autodiff ( )

Returns a struct AutodiffRenewReturn as if by executing.

auto [old_id, old_node] = get_autodiff();
auto old_number = old_node->get_output_number(old_id);
r.old_id = old_id;
r.old_node = old_node;
r.old_number = old_number;
Autodiff::STensorId new_autodiff_id()
Generates a new autodiff ID for the STensor.
Definition: stensor_base.cpp:406
std::tuple< Autodiff::STensorId, Autodiff::ComputeNodePtr > get_autodiff() const
Returns a tuple of autodifferentiation ID and node.
Definition: stensor_base.cpp:402
STensorId new_id()
Generates a new tensor ID larger than 999 to be used by auto-generated tensors.
Definition: ad_computenode.cpp:222
Autodiff::STensorId new_id
the new ID after renewing
Definition: stensor_base.h:459
Autodiff::STensorId old_id
the old ID prior to the renewing.
Definition: stensor_base.h:456
Size old_number
the output number of the old ID in the old node
Definition: stensor_base.h:458
Autodiff::ComputeNodePtr old_node
a copy of the old node pointer prior to the renewing
Definition: stensor_base.h:457
Simple helper struct returned by STensor::get_and_renew_autodiff() and STensorProxy::get_and_renew_au...
Definition: stensor_base.h:455

References get_autodiff(), new_autodiff_id(), syten::STensorImpl::Autodiff::new_id(), syten::STensorImpl::STensor::AutodiffRenewReturn::new_id, syten::STensorImpl::STensor::AutodiffRenewReturn::old_id, syten::STensorImpl::STensor::AutodiffRenewReturn::old_node, syten::STensorImpl::STensor::AutodiffRenewReturn::old_number, and SYTEN_ASSERT_MSG.

Referenced by syten::STensorImpl::exp(), syten::STensorImpl::invert_diagonal(), syten::STensorImpl::log(), syten::STensorImpl::log2(), syten::STensorImpl::project(), and syten::STensorImpl::sqrt().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: