25#include "neml2/tensors/Scalar.h"
44 return torch::operator*(a, b);
50 return Scalar(torch::abs(a), a.batch_dim());
The wrapper (decorator) for cross-referencing unresolved values at parse time.
Definition CrossRef.h:52
static Scalar ones(const torch::TensorOptions &options=default_tensor_options())
Unbatched unit tensor.
Definition FixedDimTensor.h:161
The (logical) scalar.
Definition Scalar.h:38
Scalar(Real init, const torch::TensorOptions &options)
Definition Scalar.cxx:29
static Scalar identity_map(const torch::TensorOptions &options=default_tensor_options())
The derivative of a Scalar with respect to itself.
Definition Scalar.cxx:35
Definition CrossRef.cxx:32
BatchTensor operator*(const BatchTensor &a, const BatchTensor &b)
Definition BatchTensor.cxx:153
void neml_assert_batch_broadcastable_dbg(T &&...)
A helper function to assert that (in Debug mode) all tensors are batch-broadcastable.
double Real
Definition types.h:33
Scalar abs(const Scalar &a)
Absolute value.
Definition Scalar.cxx:48