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

Function GetValues

tensorflow/core/kernels/scale_and_translate_op.cc:250–264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

248}
249
250void GetValues(OpKernelContext* context, int input_index, float* v_1,
251 float* v_2) {
252 // Tensor mutable_input(int index, False);
253 const Tensor& t = context->input(input_index);
254 OP_REQUIRES(context, t.dims() == 1,
255 errors::InvalidArgument("t must be 1-dimensional",
256 t.shape().DebugString()));
257 OP_REQUIRES(context, t.NumElements() == 2,
258 errors::InvalidArgument("t must have two elements",
259 t.shape().DebugString()));
260
261 auto data_vec = t.flat<float>().data();
262 *v_1 = data_vec[0];
263 *v_2 = data_vec[1];
264}
265
266template <typename Device, typename T>
267class ScaleAndTranslateOp : public OpKernel {

Callers 6

TEST_FFunction · 0.85
TEST_FFunction · 0.85
GetTrtWeightsMethod · 0.85
DebugStringMethod · 0.85
ComputeMethod · 0.85
ComputeMethod · 0.85

Calls 7

InvalidArgumentFunction · 0.85
inputMethod · 0.45
dimsMethod · 0.45
DebugStringMethod · 0.45
shapeMethod · 0.45
NumElementsMethod · 0.45
dataMethod · 0.45

Tested by 2

TEST_FFunction · 0.68
TEST_FFunction · 0.68