25#include "neml2/tensors/user_tensors/LogspaceFixedDimTensor.h"
29#define LOGSPACEFIXEDDIMTENSOR_REGISTER(T) register_NEML2_object_alias(Logspace##T, "Logspace" #T)
30FOR_ALL_FIXEDDIMTENSOR(LOGSPACEFIXEDDIMTENSOR_REGISTER);
42 " with exponents linearly spaced on the batch dimensions. See "
43 "neml2::BatchTensorBase::logspace for a detailed explanation.";
46 options.
set(
"start").doc() =
"The starting tensor";
49 options.
set(
"end").doc() =
"The ending tensor";
52 options.
set(
"nstep").doc() =
"The number of steps with even spacing along the new dimension";
55 options.
set(
"dim").doc() =
"Where to insert the new dimension";
58 options.
set(
"batch_dim").doc() =
"Batch dimension of the output";
61 options.
set(
"base").doc() =
"Exponent base";
68 : T(T::logspace(options.get<
CrossRef<T>>(
"start"),
73 options.get<
Real>(
"base"))),
78#define LOGSPACEFIXEDDIMTENSOR_INSTANTIATE_FIXEDDIMTENSOR(T) \
79 template class LogspaceFixedDimTensor<T>
80FOR_ALL_FIXEDDIMTENSOR(LOGSPACEFIXEDDIMTENSOR_INSTANTIATE_FIXEDDIMTENSOR);
The wrapper (decorator) for cross-referencing unresolved values at parse time.
Definition CrossRef.h:52
LogspaceFixedDimTensor(const OptionSet &options)
Construct a new LogspaceFixedDimTensor object.
Definition LogspaceFixedDimTensor.cxx:67
static OptionSet expected_options()
Definition LogspaceFixedDimTensor.cxx:34
A custom map-like data structure. The keys are strings, and the values can be nonhomogeneously typed.
Definition OptionSet.h:59
const std::string & doc() const
A readonly reference to the option set's docstring.
Definition OptionSet.h:91
T & set(const std::string &)
Definition OptionSet.h:436
Definition UserTensor.h:33
static OptionSet expected_options()
Definition UserTensor.cxx:30
std::string demangle(const char *name)
Definition parser_utils.cxx:46
Definition CrossRef.cxx:32