tensorflow/lite/kernels/conv.cc
void TransposeFloatTensor(const TfLiteTensor* input, TfLiteTensor* output) {
  const int rows = output->dims->data[1];
  const int cols = output->dims->data[0];
  const float* input_data = GetTensorData<float>(input);
  float* output_data = GetTensorData<float>(output);
  for (int i = 0; i < rows; ++i) {
    for (int j = 0; j < cols; ++j) {
      const float in_value = input_data[i * cols + j];
      output_data[j * rows + i] = in_value;
    }
  }
}
// Naive implementation of transpose for floats. Could be optimized to be more
// cache friendly, but for now it's a one-time cost on first run, and we would
// prefer to remove the need to do this at all eventually.
Naive implementation of transpose for floats. Could be optimized to be more
cache friendly, but for now it's a one-time cost on first run, and we would
prefer to remove the need to do this at all eventually.
Naive implementation of transpose for floats . Could be optimized to be more cache friendly but for now it ' s a one - time cost on first run and we would prefer to remove the need to do this at all eventually .
void TransposeFloatTensor(const TfLiteTensor* input, TfLiteTensor* output) {
  const int rows = output->dims->data[1];
  const int cols = output->dims->data[0];
  const float* input_data = GetTensorData<float>(input);
  float* output_data = GetTensorData<float>(output);
  for (int i = 0; i < rows; ++i) {
    for (int j = 0; j < cols; ++j) {
      const float in_value = input_data[i * cols + j];
      output_data[j * rows + i] = in_value;
    }
  }
}
void TransposeFloatTensor ( const TfLiteTensor * input , TfLiteTensor * output ) { const int rows = output -> dims -> data [ 1 ] ; const int cols = output -> dims -> data [ 0 ] ; const float * input_data = GetTensorData < float > ( input ) ; float * output_data = GetTensorData < float > ( output ) ; for ( int i = 0 ; i < rows ; ++ i ) { for ( int j = 0 ; j < cols ; ++ j ) { const float in_value = input_data [ i * cols + j ] ; output_data [ j * rows + i ] = in_value ; } } }
Naive implementation of transpose for floats.
Naive implementation of transpose for floats .