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

Function BM_InputRangeHelper

tensorflow/core/framework/op_kernel_test.cc:1064–1084  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1062}
1063
1064void BM_InputRangeHelper(int iters, const NodeDef& node_def,
1065 const char* input_name, int expected_start,
1066 int expected_stop) {
1067 Status status;
1068 auto device = absl::make_unique<DummyDevice>(Env::Default(), false);
1069
1070 std::unique_ptr<OpKernel> op(CreateOpKernel(DEVICE_CPU, device.get(),
1071 cpu_allocator(), node_def,
1072 TF_GRAPH_DEF_VERSION, &status));
1073 TF_CHECK_OK(status);
1074
1075 testing::StartTiming();
1076 for (int i = 0; i < iters; ++i) {
1077 int start;
1078 int stop;
1079 TF_CHECK_OK(op->InputRange(input_name, &start, &stop));
1080 EXPECT_EQ(expected_start, start);
1081 EXPECT_EQ(expected_stop, stop);
1082 }
1083 testing::StopTiming();
1084}
1085
1086REGISTER_KERNEL_BUILDER(Name("ConcatV2").Device(DEVICE_CPU), DummyKernel);
1087REGISTER_KERNEL_BUILDER(Name("Select").Device(DEVICE_CPU), DummyKernel);

Callers 2

BM_ConcatInputRangeFunction · 0.85
BM_SelectInputRangeFunction · 0.85

Calls 7

DefaultFunction · 0.85
CreateOpKernelFunction · 0.85
cpu_allocatorFunction · 0.85
StartTimingFunction · 0.85
StopTimingFunction · 0.85
InputRangeMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected