MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / TransposeOpConstModel

Class TransposeOpConstModel

tensorflow/lite/kernels/transpose_test.cc:164–176  ·  view source on GitHub ↗

Tests case where perm is a const tensor. Example usage is as follows: SpaceToBatchNDOpConstModel m(input_shape, perm_shape, perm_data); m.SetInput(input_data); m.Invoke();

Source from the content-addressed store, hash-verified

162// m.SetInput(input_data);
163// m.Invoke();
164class TransposeOpConstModel : public TransposeOpModel {
165 public:
166 TransposeOpConstModel(std::initializer_list<int> input_shape,
167 std::initializer_list<int> perm_shape,
168 std::initializer_list<int> perm) {
169 input_ = AddInput(TensorType_FLOAT32);
170 perm_ = AddConstInput(TensorType_INT32, perm, perm_shape);
171 output_ = AddOutput(TensorType_FLOAT32);
172 SetBuiltinOp(BuiltinOperator_TRANSPOSE, BuiltinOptions_TransposeOptions,
173 CreateTransposeOptions(builder_).Union());
174 BuildInterpreter({input_shape});
175 }
176};
177
178// Tests case where perm is a non-const tensor.
179//

Callers 1

TESTFunction · 0.85

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.68