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

◆ is_consistent()

bool MayaFlux::Kakshya::TensorSet::is_consistent ( ) const
nodiscard

Whether every tensor is valid and named, with no duplicate names.

Definition at line 194 of file Tensor.cpp.

195{
196 for (size_t i = 0; i < tensors.size(); ++i) {
197 const auto& name = tensors[i].spec().name;
198 if (name.empty() || !tensors[i].is_valid() || !tensors[i].spec().is_valid())
199 return false;
200 for (size_t j = i + 1; j < tensors.size(); ++j) {
201 if (tensors[j].spec().name == name)
202 return false;
203 }
204 }
205 return true;
206}
std::vector< TensorData > tensors
Definition Tensor.hpp:168

References tensors.

Referenced by MayaFlux::IO::NpzWriter::write(), and MayaFlux::IO::SafetensorsWriter::write().

Here is the caller graph for this function: