25#include "neml2/tensors/user_tensors/LinspaceBatchTensor.h"
26#include "neml2/base/CrossRef.h"
36 options.
doc() =
"Construct a BatchTensor linearly spaced on the batch dimensions. See "
37 "neml2::BatchTensorBase::linspace for a detailed explanation.";
40 options.
set(
"start").doc() =
"The starting tensor";
43 options.
set(
"end").doc() =
"The ending tensor";
46 options.
set(
"nstep").doc() =
"The number of steps with even spacing along the new dimension";
49 options.
set(
"dim").doc() =
"Where to insert the new dimension";
52 options.
set(
"batch_dim").doc() =
"Batch dimension of the output";
55 options.
set(
"batch_expand").doc() =
"After construction, perform an additional batch expanding "
56 "operation into the given batch shape.";
BatchTensor batch_expand(TorchShapeRef batch_size) const
Return a new view of the tensor with values broadcast along the batch dimensions.
Definition BatchTensorBase.cxx:219
Definition BatchTensor.h:32
The wrapper (decorator) for cross-referencing unresolved values at parse time.
Definition CrossRef.h:52
Create a linspace BatchTensor from the input file.
Definition LinspaceBatchTensor.h:37
LinspaceBatchTensor(const OptionSet &options)
Construct a new LinspaceBatchTensor object.
Definition LinspaceBatchTensor.cxx:61
static OptionSet expected_options()
Definition LinspaceBatchTensor.cxx:33
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
const T & get(const std::string &) const
Definition OptionSet.h:422
T & set(const std::string &)
Definition OptionSet.h:436
Definition UserTensor.h:33
static OptionSet expected_options()
Definition UserTensor.cxx:30
Definition CrossRef.cxx:32
std::vector< TorchSize > TorchShape
Definition types.h:36