25#include <tflchef.pb.h>
26#include <mio/tflite/schema_generated.h>
36 const ::tflchef::TensorSparsity_IndexVec &value);
53template <
typename T>
class FormatConverter
56 FormatConverter(
const std::vector<int32_t> &shape,
const std::vector<int32_t> &traversal_order,
57 const std::vector<TfLiteDimensionType> &format,
58 const std::vector<int32_t> &block_size = {},
59 const std::vector<int32_t> &block_map = {});
63 const std::vector<T> &
GetData() {
return data_; }
64 const std::vector<std::vector<int32_t>> &
GetDimMetadata() {
return dim_metadata_; }
67 bool IsZero(
const T val);
70 std::vector<int32_t> dense_shape_;
71 std::vector<int32_t> blocked_shape_;
73 std::vector<int32_t> traversal_order_;
74 std::vector<TfLiteDimensionType> format_;
75 std::vector<int32_t> block_size_;
76 std::vector<int32_t> block_map_;
77 std::vector<std::vector<int32_t>> dim_metadata_;
81extern template class FormatConverter<float>;
82extern template class FormatConverter<uint16_t>;
Helper class to hold data needed in creation of a FlatBuffer. To serialize data, you typically call o...
tflite::ActivationFunctionType as_tflite_activation(const tflchef::Activation &value)
tflite::MirrorPadMode as_tflite_mirrorpadmode(const tflchef::MirrorPadMode &value)
tflite::DimensionType as_tflite_dimensiontype(const tflchef::DimensionType &value)
tflite::SparseIndexVector as_tflite_sparse_idx_vec_type(const tflchef::SparseIndexVecType &value)
flatbuffers::Offset< void > as_tflite_sparse_index_vec(flatbuffers::FlatBufferBuilder &fb, const ::tflchef::TensorSparsity_IndexVec &value)
tflite::Padding as_tflite_padding(const tflchef::Padding &value)
tflite::TensorType as_tflite_tensortype(const tflchef::TensorType &value)