Define _TORCH_OPTIM_SERIALIZE_TORCH_ARG#
Defined in File serialize.h
Define Documentation#
-
_TORCH_OPTIM_SERIALIZE_TORCH_ARG(name)
{ \
auto ivalue = torch::IValue(name()); \
/* do not serialize if name is an undefined tensor*/ \
if (!(ivalue.isTensor() && \
ivalue.unsafeToTensorImpl() == \
at::UndefinedTensorImpl::singleton())) { \
archive.write(#name, ivalue); \
} \
}
#