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

Function TEST_F

tensorflow/core/kernels/data/map_defun_op_test.cc:222–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

220 {TestCase1(), TestCase2(), TestCase3()})));
221
222TEST_F(MapDefunOpTest, InvalidArguments) {
223 int thread_num = 2, cpu_num = 2;
224 TF_ASSERT_OK(InitThreadPool(thread_num));
225 std::vector<TestCase> test_cases = {InvalidOutputTypes(),
226 InvalidOutputShapes(), InvalidInputs()};
227 for (auto& test_case : test_cases) {
228 TF_ASSERT_OK(InitFunctionLibraryRuntime(test_case.func_lib, cpu_num));
229
230 std::unique_ptr<OpKernel> map_defun_kernel;
231 TF_ASSERT_OK(CreateMapDefunOpKernel(
232 test_case.t_arguments, test_case.t_captured, test_case.output_dtypes,
233 test_case.output_shapes, test_case.func,
234 test_case.max_intra_op_parallelism, &map_defun_kernel));
235 gtl::InlinedVector<TensorValue, 4> inputs;
236 for (auto& arg : test_case.arguments) {
237 inputs.emplace_back(&arg);
238 }
239 for (auto& captured_input : test_case.captured_inputs) {
240 inputs.emplace_back(&captured_input);
241 }
242 std::unique_ptr<OpKernelContext> context;
243 TF_ASSERT_OK(
244 CreateMapDefunContext(map_defun_kernel.get(), &inputs, &context));
245 EXPECT_EQ(RunOpKernel(map_defun_kernel.get(), context.get()).code(),
246 tensorflow::error::INVALID_ARGUMENT);
247 }
248}
249
250} // namespace
251} // namespace data

Callers

nothing calls this directly

Calls 6

InvalidOutputTypesFunction · 0.85
InvalidOutputShapesFunction · 0.85
InvalidInputsFunction · 0.85
emplace_backMethod · 0.45
getMethod · 0.45
codeMethod · 0.45

Tested by

no test coverage detected