class
SushiAI::NN::Parameter
Holds a learnable tensor's metadata and graph value identifier.
- Declared in
include/SushiAI/nn/module.hpp
Public member functions
Parameter()=defaultGraph::ValueId declare(const Graph::GraphBuilder &builder, Shape shape, ParameterRole role, int64_t fan_in, int64_t fan_out, std::string_view debug_name, DType dtype=DType::FLOAT32)Declares this parameter into the graph idempotently.
Parameters
builderGraph builder where the parameter node is registered.
shapeExtents of the parameter tensor.
roleRole indicating whether parameter is weight or bias.
debug_nameName that must outlive the graph builder.
Returns
ValueId assigned to this parameter.
bool declared() const noexceptWhether forward() has declared this parameter yet.
Graph::ValueId id() const noexceptThe parameter's value id, or Graph::NO_VALUE before declaration.
const Shape & shape() const noexceptThe parameter's extents.
DType dtype() const noexceptThe parameter's element type.
ParameterRole role() const noexceptWhether this is a weight or a bias.
int64_t fan_in() const noexceptInputs feeding one output unit.
int64_t fan_out() const noexceptOutputs one input unit feeds.

