Benign repos Download

dataset_utils_test.cc

imports tensorflow/core/platform/str_util.himports tensorflow/core/platform/test.h
SHA-2567c3f87179e59b59c93635456deffa1122d68d02febc57a5149e5cf38b75ebb2a

Evidence

apache web server name lines 1–10
1/* Copyright 2018 The TensorFlow Authors. All Rights Reserved.
2
3Licensed under the Apache License, Version 2.0 (the "License");
4you may not use this file except in compliance with the License.
5You may obtain a copy of the License at
6
7 http://www.apache.org/licenses/LICENSE-2.0
8
9Unless required by applicable law or agreed to in writing, software
10distributed under the License is …
imports tensorflow/core/platform/str_util.h lines 11–56
11:42… IND, either express or implied.
12See the License for the specific language governing permissions and
13limitations under the License.
14==============================================================================*/
15
16#include "tensorflow/core/data/dataset_utils.h"
17
18#include <cstdint>
19#include <functional>
20#include <memory>
21#include <string>
22#include <vector>
23
24#include <gmock/gmock.h>
25#include "absl/container/flat_hash_set.h"
26#include "absl/status/status.h"
27#include "absl/status/status_matchers.h"
28#include "absl/strings/str_join.h"
29#include "xla/tsl/platform/status_matchers.h"
30#include "xla/tsl/protobuf/error_codes.pb.h"
31#include "xla/tsl/util/determinism_test_util.h"
32#include "tensorflow/core/data/compression_utils.h"
33#include "tensorflow/core/data/dataset_test_base.h"
34#include "tensorflow/core/data/serialization_utils.h"
35#include "tensorflow/core/data/test_utils.h"
36#include "tensorflow/core/framework/dataset.h"
37#include "tensorflow/core/framework/dataset.pb.h"
38#include "tensorflow/core/framework/dataset_options.pb.h"
39#include "tensorflow/core/framework/function.h"
40#include "tensorflow/core/framework/function.pb.h"
41#include "tensorflow/core/framework/node_def_builder.h"
42#include "tensorflow/core/framework/op.h"
43#include "tensorflow/core/framework/types.pb.h"
44#include "tensorflow/core/framework/variant.h"
45#include "tensorflow/core/lib/core/status_test_util.h"
46#include "tensorflow/core/platform/str_util.h"
47#include "tensorflow/core/platform/test.h"
48#include "tensorflow/core/protobuf/error_codes.pb.h"
49#include "tensorflow/core/util/work_sharder.h"
50
51namespace tensorflow {
⋯5 lines
C/C++ unit-test EXPECT_TRUE marker lines 56–61
56:16… sting::StatusIs;
57
58TEST(DatasetUtilsTest, MatchesAnyVersion) {
59 EXPECT_TRUE(MatchesAnyVersion("BatchDataset", "BatchDataset"));
60 EXPECT_TRUE(MatchesAnyVersion("BatchDataset", "BatchDatasetV2"));
61 EXPEC …
C/C++ unit-test EXPECT_EQ marker lines 135–138
135:2… absl::Status s = AddToFunctionLibrary(&flib_0, fdef_to_add);
136 EXPECT_EQ(error::Code::INVALID_ARGUMENT, s.code());
137 EXPECT_EQ(
138 "Cannot add function '0' because a different function with the sam …
C/C++ unit-test ASSERT_EQ marker lines 174–180
174:37… nst std::function<void()> fn) { fn(); }, 2);
175 auto fn = []() { ASSERT_EQ(GetPerThreadMaxParallelism(), 2); };
176 runner(fn);
177}
178
179TEST(DatasetUtilsTest, ParseDeterminismPolicy) {
180 DeterminismPolicy dete …

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.