MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / CallEigenVersion

Method CallEigenVersion

tensorflow/core/kernels/mkl_concat_op.cc:830–870  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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:

Callers

nothing calls this directly

Calls 10

IsMklTensorMethod · 0.80
GetTfShapeMethod · 0.80
SetMklTensorMethod · 0.80
SetDimensionsMethod · 0.80
sizeMethod · 0.45
push_backMethod · 0.45
shapeMethod · 0.45
ComputeMethod · 0.45
dimsMethod · 0.45

Tested by

no test coverage detected