23#ifndef __NNFW_MISC_FEATURE_OBJECT_H__
24#define __NNFW_MISC_FEATURE_OBJECT_H__
55 _value.resize(_shape.
C * _shape.
H * _shape.
W);
57 for (int32_t ch = 0; ch < _shape.
C; ++ch)
59 for (int32_t row = 0; row < _shape.
H; ++row)
61 for (int32_t col = 0; col < _shape.
W; ++col)
63 _value.at(offsetOf(ch, row, col)) = fn(_shape,
Index{ch, row, col});
84 T
at(uint32_t ch, uint32_t row, uint32_t col)
const override
86 return _value.at(offsetOf(ch, row, col));
97 uint32_t offsetOf(uint32_t ch, uint32_t row, uint32_t col)
const
99 return ch * _shape.
H * _shape.
W + row * _shape.
W + col;
110 std::vector<T> _value;
Class to have the index information for calculating the offset.
Class to have information of the operand for feature.
const Shape & shape(void) const
Get Shape of feature as the reference.
Object(const Shape &shape, const Generator &fn)
Construct Object object with Shape of feature and set value used by Generator.
std::function< T(const Shape &shape, const Index &index)> Generator
T at(uint32_t ch, uint32_t row, uint32_t col) const override
Get the value used by three indexes.
This file contains Index class.
This file contains Reader class.
This file contains Shape class for feature.
Class reads values of feature The interface class.
Structure to have values of dimensions for feature.