message: Fixed transpose attributes parsing.
  Treating 2d shapes as BC and 3d shapes as BWC.
diff: @@ -2103,12 +2103,36 @@ class TransposeOperationParser : public TFLiteOperationParser {
  TransposeAttributes attr;
  Tensor<Linear, DataType::INT32> perm;
  RETURN_IF_ERROR(reader->ReadTensor(1, &perm));
  + std::map<Axis, int> axis_to_index = {{Axis::BATCH, 0},
  + {Axis::HEIGHT, 1},
  + {Axis::WIDTH, 2},
  + {Axis::CHANNELS, 3}};
  if (perm.data.size() == 4) {
  attr.perm = BHWC(perm.data[0], perm.data[1], perm.data[2], perm.data[3]);
  } else if (perm.data.size() == 3) {
  - attr.perm = BHWC(0, perm.data[0] + 1, perm.data[1] + 1, perm.data[2] + 1);
  + std::vector<Axis> index_to_axis = {Axis::CHANNELS, Axis::WIDTH,
  + Axis::BATCH};
  + std::map<Axis, Axis> remap = {
  + {Axis::HEIGHT, Axis::HEIGHT},
  + {index_to_axis[perm.data[2]], Axis::BATCH},
  + {index_to_axis[perm.data[1]], Axis::WIDTH},
  + {index_to_axis[perm.data[0]], Axis::CHANNELS}};
  + attr.perm.b = axis_to_index[remap[Axis::BATCH]];
  + attr.perm.h = axis_to_index[remap[Axis::HEIGHT]];
  + attr.perm.w = axis_to_index[remap[Axis::WIDTH]];
  + attr.perm.c = axis_to_index[remap[Axis::CHANNELS]];
  +
  } else if (perm.data.size() == 2) {
  - attr.perm = BHWC(0, 1, perm.data[0] + 2, perm.data[1] + 2);
  + std::vector<Axis> index_to_axis = {Axis::CHANNELS, Axis::BATCH};
  + std::map<Axis, Axis> remap = {
  + {Axis::HEIGHT, Axis::HEIGHT},
  + {Axis::WIDTH, Axis::WIDTH},
  + {index_to_axis[perm.data[1]], Axis::BATCH},
  + {index_to_axis[perm.data[0]], Axis::CHANNELS}};
  + attr.perm.b = axis_to_index[remap[Axis::BATCH]];
  + attr.perm.h = axis_to_index[remap[Axis::HEIGHT]];
  + attr.perm.w = axis_to_index[remap[Axis::WIDTH]];
  + attr.perm.c = axis_to_index[remap[Axis::CHANNELS]];
  } else {
  return absl::InvalidArgumentError(
  "Permutation for transpose is invalid.");
  