MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
Weights.hpp File Reference

Checking a set of tensors against what a network needs, and packing it into one float32 buffer. More...

Include dependency graph for Yantra/Executors/TensorKernels/Weights.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  MayaFlux::Yantra::TensorKernels::PackedWeights
 The required tensors as float32 in one run, in the order they were required. More...
struct  MayaFlux::Yantra::TensorKernels::TensorRequirement
 One tensor a network needs. More...

Namespaces

namespace  MayaFlux
 Main namespace for the Maya Flux audio engine.
namespace  MayaFlux::Yantra
namespace  MayaFlux::Yantra::TensorKernels
namespace  MayaFlux::Yantra::TensorKernels::detail

Functions

std::string MayaFlux::Yantra::TensorKernels::check_tensors (const Kakshya::TensorSet &weights, std::span< const TensorRequirement > required)
 Whether a set holds every required tensor with the required shape.
size_t MayaFlux::Yantra::TensorKernels::detail::element_count (const std::vector< uint64_t > &shape)
std::expected< PackedWeights, std::string > MayaFlux::Yantra::TensorKernels::pack_weights (const Kakshya::TensorSet &weights, std::span< const TensorRequirement > required)
 Convert the required tensors to float32 and lay them out in the order of required.
std::string MayaFlux::Yantra::TensorKernels::detail::shape_text (const std::vector< uint64_t > &shape)
void MayaFlux::Yantra::TensorKernels::upload_packed_weights (GpuDispatchCore &context, uint32_t set, size_t binding, const PackedWeights &packed)
 Allocate a shared buffer on a context and fill it with packed weights.

Detailed Description

Checking a set of tensors against what a network needs, and packing it into one float32 buffer.

A network built from the tensor kernels lists the tensors it needs by name and shape, in the order its layers use them. check_tensors says whether a set holds them, pack_weights converts them to float32 and lays them out one after another, and upload_packed_weights puts the result on a context, where PackedWeights::address gives each tensor's device address for a stage.

Definition in file Yantra/Executors/TensorKernels/Weights.hpp.