MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ to_tensor()

std::shared_ptr< Kakshya::TensorContainer > MayaFlux::Yantra::LagProfile::to_tensor ( std::string name) const
inlinenodiscard

The profile as a windows by lags float64 tensor.

Parameters
nameName of the tensor.
Returns
The container, or nullptr when the profile holds nothing.

Definition at line 179 of file WaveformAnalyzer.hpp.

180 {
181 if (values.empty() || lag_count == 0) {
182 return nullptr;
183 }
184 auto data = Kakshya::TensorData::from_values<double>(values, { values.size() / lag_count, lag_count }, std::move(name));
185 return data ? std::make_shared<Kakshya::TensorContainer>(std::move(*data)) : nullptr;
186 }
static std::optional< TensorData > from_values(std::span< const T > values, std::vector< uint64_t > shape={}, std::string name={})
Contiguous tensor holding a copy of typed values.
Definition Tensor.hpp:75
uint32_t lag_count
Columns per window.
std::vector< double > values
Window major: window w, column c is values[w * lag_count + c].

References MayaFlux::Kakshya::TensorData::from_values(), lag_count, and values.

Here is the call graph for this function: