| 170 | } |
| 171 | |
| 172 | TEST_F(TensorDatasetOpTest, DatasetTypeString) { |
| 173 | int thread_num = 2, cpu_num = 2; |
| 174 | TF_ASSERT_OK(InitThreadPool(thread_num)); |
| 175 | TF_ASSERT_OK(InitFunctionLibraryRuntime({}, cpu_num)); |
| 176 | |
| 177 | const TestCase &test_case = PlainTensorsTestCase(); |
| 178 | std::vector<Tensor> components = test_case.components; |
| 179 | gtl::InlinedVector<TensorValue, 4> inputs; |
| 180 | for (auto &component : components) { |
| 181 | inputs.push_back(TensorValue(&component)); |
| 182 | } |
| 183 | std::unique_ptr<OpKernel> tensor_dataset_kernel; |
| 184 | TF_ASSERT_OK(CreateTensorDatasetKernel(test_case.expected_output_dtypes, |
| 185 | test_case.expected_output_shapes, |
| 186 | &tensor_dataset_kernel)); |
| 187 | std::unique_ptr<OpKernelContext> tensor_dataset_context; |
| 188 | TF_ASSERT_OK(CreateTensorDatasetContext(tensor_dataset_kernel.get(), &inputs, |
| 189 | &tensor_dataset_context)); |
| 190 | DatasetBase *tensor_dataset; |
| 191 | TF_ASSERT_OK(CreateDataset(tensor_dataset_kernel.get(), |
| 192 | tensor_dataset_context.get(), &tensor_dataset)); |
| 193 | core::ScopedUnref scoped_unref(tensor_dataset); |
| 194 | |
| 195 | EXPECT_EQ(tensor_dataset->type_string(), |
| 196 | name_utils::OpName(TensorDatasetOp::kDatasetType)); |
| 197 | } |
| 198 | |
| 199 | TEST_F(TensorDatasetOpTest, DatasetNodeName) { |
| 200 | int thread_num = 2, cpu_num = 2; |
nothing calls this directly
no test coverage detected