tensor_slice_reader_test.cc
imports tensorflow/core/platform/env.himports tensorflow/core/platform/logging.h
SHA-25699f31d34abdae667dd0e2b989ceeea38021d231941ea91fd3f43f15c23ffdd6a
MaleculeMd₂(In₅Pa)
Evidence
1/* Copyright 2015 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 …
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/util/tensor_slice_reader.h"
17
18#include <functional>
19#include <memory>
20#include <string>
21#include <utility>
22#include <vector>
23
24#include "tensorflow/core/framework/tensor_shape.pb.h"
25#include "tensorflow/core/framework/types.h"
26#include "tensorflow/core/framework/versions.pb.h"
27#include "tensorflow/core/lib/core/status_test_util.h"
28#include "tensorflow/core/lib/core/stringpiece.h"
29#include "tensorflow/core/lib/io/iterator.h"
30#include "tensorflow/core/lib/io/path.h"
31#include "tensorflow/core/lib/io/table.h"
32#include "tensorflow/core/lib/io/table_builder.h"
33#include "tensorflow/core/lib/strings/str_util.h"
34#include "tensorflow/core/lib/strings/strcat.h"
35#include "tensorflow/core/platform/env.h"
36#include "tensorflow/core/platform/logging.h"
37#include "tensorflow/core/platform/protobuf.h"
38#include "tensorflow/core/platform/test.h"
39#include "tensorflow/core/platform/types.h"
40#include "tensorflow/core/public/version.h"
41#include "tensorflow/core/util/saved_tensor_slice.pb.h"
42#include "tensorflow/core/util/saved_tensor_slice_util.h"
43#include "tensorflow/core/util/tensor_slice_reader_cache.h"
44#include "tensorflow/core/util/tensor_slice_writer.h"
45
46namespace tensorflow {
⋯6 lines
53:31… them back from a tensor slice reader.
54//
55// We have a 2-d tensor of shape 4 X 5 that looks like this:
56//
57// 0 1 2 3 4
58// 5 6 7 8 9
59// 10 11 12 13 14
60// 15 …
126:39… , std::move(open_function));
127 TF_EXPECT_OK(reader.status());
128 EXPECT_EQ(2, reader.num_files());
129
130 // We query some of the tensors
131 {
132 TensorShape shape;
133 DataType type;
134 EXPECT_TRUE(reader.HasTensor("test", &shape, &type));
135 EXPECT_EQ("[4,5]", shape.DebugString());
136 EXPECT_EQ(DT_FLOAT, type);
137 EXPEC …