Read a one-element optimizer-state tensor back as a double.
Accepts the tensor on either device and in any of F32, F64, I32 or I64 — a checkpoint loader may rebuild the scalar on the parameter's device, with whatever dtype it was saved in.
Parameters
tconst TensorImpl&Tensor with exactly one element.
Returns
doubleThe element, converted to double.
Raises
:runtime_errorIf
t does not hold exactly one element or has another dtype.