Merge pull request #26646 from amitsrivastava78:error_4
PiperOrigin-RevId: 238732653
This commit is contained in:
commit
8b5a7c680b
@ -135,7 +135,7 @@ TfLiteStatus ArenaPlanner::PlanAllocations() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Count references to node input tensors.
|
// Count references to node input tensors.
|
||||||
for (int i = 0; i < graph_info_->num_nodes(); ++i) {
|
for (size_t i = 0; i < graph_info_->num_nodes(); ++i) {
|
||||||
const TfLiteNode& node = graph_info_->node(i);
|
const TfLiteNode& node = graph_info_->node(i);
|
||||||
TfLiteIntArray* node_inputs = node.inputs;
|
TfLiteIntArray* node_inputs = node.inputs;
|
||||||
for (int j = 0; j < node_inputs->size; ++j) {
|
for (int j = 0; j < node_inputs->size; ++j) {
|
||||||
|
@ -204,7 +204,7 @@ class SingleOpModel {
|
|||||||
const int channel_index = params->quantized_dimension;
|
const int channel_index = params->quantized_dimension;
|
||||||
|
|
||||||
std::vector<int32_t> shape(t->dims->size);
|
std::vector<int32_t> shape(t->dims->size);
|
||||||
for (int i = 0; i < shape.size(); ++i) {
|
for (size_t i = 0; i < shape.size(); ++i) {
|
||||||
shape[i] = t->dims->data[i];
|
shape[i] = t->dims->data[i];
|
||||||
}
|
}
|
||||||
const int32_t num_inputs = input_data.size();
|
const int32_t num_inputs = input_data.size();
|
||||||
|
@ -40,18 +40,6 @@ void RunTestPermutation(const std::vector<int>& shape,
|
|||||||
input[i] = i;
|
input[i] = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create reversed and padded perms.
|
|
||||||
int reversed_perms[4];
|
|
||||||
for (int output_k = 0, input_k = shape.size() - 1; output_k < shape.size();
|
|
||||||
output_k++, input_k--) {
|
|
||||||
reversed_perms[output_k] = shape.size() - perms[input_k] - 1;
|
|
||||||
}
|
|
||||||
// Unused dimensions should not be permuted so pad with identity transform
|
|
||||||
// subset.
|
|
||||||
for (int k = shape.size(); k < 4; k++) {
|
|
||||||
reversed_perms[k] = k;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make input and output shapes.
|
// Make input and output shapes.
|
||||||
const RuntimeShape input_shape = GetTensorShape(shape);
|
const RuntimeShape input_shape = GetTensorShape(shape);
|
||||||
RuntimeShape output_shape(perms.size());
|
RuntimeShape output_shape(perms.size());
|
||||||
|
Loading…
Reference in New Issue
Block a user