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

Function CopyTfTensorInToOutWithShape

tensorflow/core/util/mkl_util.h:840–856  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

838}
839
840inline void CopyTfTensorInToOutWithShape(OpKernelContext* context, int idx_in,
841 int idx_out,
842 const TensorShape& shape) {
843 int num_inputs = context->num_inputs();
844 int num_outputs = context->num_outputs();
845 int idx_data_in = GetTensorDataIndex(idx_in, num_inputs);
846 int idx_data_out = GetTensorDataIndex(idx_out, num_outputs);
847
848 const Tensor& data = context->input(idx_data_in);
849 MklDnnShape mkl_shape_output;
850 mkl_shape_output.SetMklTensor(false);
851 AllocateOutputSetMklShape(context, idx_out, mkl_shape_output);
852 Tensor output(data.dtype());
853 // TODO(intel_tf): alternatively, call forward_input_to_output_with_shape(...)
854 CHECK(output.CopyFrom(data, shape));
855 context->set_output(idx_data_out, output);
856}
857
858inline void ForwardTfTensorInToOut(OpKernelContext* context, int idx_in,
859 int idx_out) {

Callers 1

ComputeMethod · 0.85

Calls 9

GetTensorDataIndexFunction · 0.85
SetMklTensorMethod · 0.80
num_inputsMethod · 0.45
num_outputsMethod · 0.45
inputMethod · 0.45
dtypeMethod · 0.45
CopyFromMethod · 0.45
set_outputMethod · 0.45

Tested by

no test coverage detected