message: Enable explicit batch mode transpose
diff: @@ -1456,12 +1456,13 @@ Status Converter::TransposeTensor(nvinfer1::ITensor* input_tensor,
  absl::string_view name,
  nvinfer1::ITensor** output_tensor) {
  const auto dims = input_tensor->getDimensions();
  -
  - if (order_with_batch_dim.size() - 1 != size_t(dims.nbDims)) {
  + const int order_size = use_implicit_batch_ ? order_with_batch_dim.size() - 1
  + : order_with_batch_dim.size();
  + if (order_size != size_t(dims.nbDims)) {
  return errors::InvalidArgument(
  "Rank of perm for transpose does not match with that of the input.");
  }
  - if (order_with_batch_dim[0] != 0) {
  + if (use_implicit_batch_ && order_with_batch_dim[0] != 0) {
  return errors::Unimplemented(
  "Transpose at batch dimension is not supported.");
  }
  @@ -1472,9 +1473,14 @@ Status Converter::TransposeTensor(nvinfer1::ITensor* input_tensor,
  MarkQuantizationRangesAsInferrable(input_tensor, layer->getOutput(0));
  nvinfer1::Permutation permutation;
  + if (use_implicit_batch_) {
  for (int32_t i = 0; i < dims.nbDims; ++i) {
  permutation.order[i] = order_with_batch_dim[i + 1] - 1;
  }
  + } else {
  + std::copy(order_with_batch_dim.begin(), order_with_batch_dim.end(),
  + permutation.order);
  + }
  VLOG(1) << "TransposeTensor permutation: "
  << DebugString(permutation, dims.nbDims);
  layer->setFirstTranspose(permutation);
  @@ -2271,11 +2277,13 @@ Status ConvertTranspose(OpConverterParams* params) {
  // Verify the permutation.
  nvinfer1::ITensor* input_tensor = inputs.at(0).tensor();
  - if (perm.size() - 1 != size_t(input_tensor->getDimensions().nbDims)) {
  + const int perm_size =
  + params->use_implicit_batch ? perm.size() - 1 : perm.size();
  + if (perm_size != size_t(input_tensor->getDimensions().nbDims)) {
  return errors::InvalidArgument(
  "Rank of perm for transpose does not match with that of the input.");
  }
  - if (perm[0] != 0) {
  + if (params->use_implicit_batch && perm[0] != 0) {
  return errors::Unimplemented(
  "Transpose at batch dimension is not supported.");
  }
  