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

Function TEST_F

tensorflow/core/kernels/dynamic_partition_op_test.cc:52–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50};
51
52TEST_F(DynamicPartitionOpTest, Simple_OneD) {
53 MakeOp();
54
55 TF_ASSERT_OK(InitOp());
56 // Similar to how we would use this to split embedding ids to be looked up
57
58 // Feed and run
59 AddInputFromArray<float>(TensorShape({6}), {0, 13, 2, 39, 4, 17});
60 AddInputFromArray<int32>(TensorShape({6}), {0, 0, 2, 3, 2, 1});
61 TF_ASSERT_OK(RunOpKernel());
62
63 // Check the output sizes
64 { // Output 0
65 Tensor expected(allocator(), DT_FLOAT, TensorShape({2}));
66 test::FillValues<float>(&expected, {0, 13});
67 test::ExpectTensorEqual<float>(expected, *GetOutput(0));
68 }
69 { // Output 1
70 Tensor expected(allocator(), DT_FLOAT, TensorShape({1}));
71 test::FillValues<float>(&expected, {17});
72 test::ExpectTensorEqual<float>(expected, *GetOutput(1));
73 }
74 { // Output 2
75 Tensor expected(allocator(), DT_FLOAT, TensorShape({2}));
76 test::FillValues<float>(&expected, {2, 4});
77 test::ExpectTensorEqual<float>(expected, *GetOutput(2));
78 }
79 { // Output 3
80 Tensor expected(allocator(), DT_FLOAT, TensorShape({1}));
81 test::FillValues<float>(&expected, {39});
82 test::ExpectTensorEqual<float>(expected, *GetOutput(3));
83 }
84}
85
86TEST_F(DynamicPartitionOpTest, gpu_Simple_OneD) {
87 MakeOp();

Callers

nothing calls this directly

Calls 8

GetOutputFunction · 0.85
TensorShapeClass · 0.50
SetDeviceFunction · 0.50
NewDeviceFunction · 0.50
StrContainsFunction · 0.50
SyncMethod · 0.45
AddDimMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected