| 828 | } |
| 829 | |
| 830 | void CallEigenVersion(OpKernelContext* context, const OpInputList& values, |
| 831 | const OpInputList& input_mins, |
| 832 | const OpInputList& input_maxes, |
| 833 | const MklDnnShapeList& mkl_input_shapes, |
| 834 | bool quantized_input) { |
| 835 | size_t num_mkl_input_shapes = mkl_input_shapes.size(); |
| 836 | DCHECK_EQ(values.size(), num_mkl_input_shapes); |
| 837 | std::vector<Tensor> converted_values(num_mkl_input_shapes); |
| 838 | TensorShapeList tf_input_shapes; |
| 839 | for (size_t i = 0; i < num_mkl_input_shapes; ++i) { |
| 840 | if (mkl_input_shapes[i].IsMklTensor()) { |
| 841 | // do conversion from OneDNN to TF |
| 842 | OP_REQUIRES_OK( |
| 843 | context, ConvertMklToTF<T>(context, values[i], mkl_input_shapes[i], |
| 844 | &converted_values[i])); |
| 845 | tf_input_shapes.push_back(mkl_input_shapes[i].GetTfShape()); |
| 846 | } else { |
| 847 | // no conversion since it is TF tensor already |
| 848 | converted_values[i] = values[i]; |
| 849 | tf_input_shapes.push_back(values[i].shape()); |
| 850 | } |
| 851 | } |
| 852 | |
| 853 | // Call Eigen concat. |
| 854 | eigen_concat_op_.Compute(context, converted_values, tf_input_shapes, |
| 855 | input_mins, input_maxes, quantized_input); |
| 856 | |
| 857 | // Get the number of dims from first input since all input tensors |
| 858 | // should have same rank. |
| 859 | size_t dims = values[0].shape().dims(); |
| 860 | MklDnnShape output_data_mkl_shape; |
| 861 | output_data_mkl_shape.SetMklTensor(false); |
| 862 | output_data_mkl_shape.SetDimensions(dims); |
| 863 | AllocateOutputSetMklShape(context, 0, output_data_mkl_shape); |
| 864 | if (quantized_input) { |
| 865 | MklDnnShape output_min_max_mkl_shape; |
| 866 | output_min_max_mkl_shape.SetMklTensor(false); |
| 867 | AllocateOutputSetMklShape(context, 1, output_min_max_mkl_shape); |
| 868 | AllocateOutputSetMklShape(context, 2, output_min_max_mkl_shape); |
| 869 | } |
| 870 | } |
| 871 | |
| 872 | // This method finds the most common format across all OneDNN inputs |
| 873 | // Inputs: |
nothing calls this directly
no test coverage detected