1 /* Copyright 2017 The TensorFlow Authors. All Rights Reserved. 2 3 Licensed under the Apache License, Version 2.0 (the "License"); 4 you may not use this file except in compliance with the License. 5 You may obtain a copy of the License at 6 7 http://www.apache.org/licenses/LICENSE-2.0 8 9 Unless required by applicable law or agreed to in writing, software 10 distributed under the License is distributed on an "AS IS" BASIS, 11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 See the License for the specific language governing permissions and 13 limitations under the License. 14 ==============================================================================*/ 15 #ifndef TENSORFLOW_CORE_KERNELS_DATA_WINDOW_DATASET_H_ 16 #define TENSORFLOW_CORE_KERNELS_DATA_WINDOW_DATASET_H_ 17 18 #include <vector> 19 20 #include "tensorflow/core/framework/dataset.h" 21 #include "tensorflow/core/framework/partial_tensor_shape.h" 22 #include "tensorflow/core/framework/tensor.h" 23 #include "tensorflow/core/framework/types.h" 24 25 namespace tensorflow { 26 namespace data { 27 28 // Creates a dataset representing an eagerly-collected window of elements. 29 // 30 // The `elements` argument defines the elements of the resulting 31 // dataset, which is stored in `out_dataset`. 32 // 33 // This dataset is constructed internally for use in datasets that 34 // build nested dataset expressions (e.g. the reducer function for 35 // GroupByWindowDataset). It efficiently supports multiple iterators on 36 // the same window without recomputation. 37 // 38 // REQUIRES: `output_types` must match the types of the respective 39 // element components in `elements`. 40 // REQUIRES: `output_shapes` must be compatible with the shapes of the 41 // respective element components in `elements`.a 42 Status NewWindowDataset(std::vector<std::vector<Tensor>> elements, 43 DataTypeVector output_types, 44 std::vector<PartialTensorShape> output_shapes, 45 DatasetBase** out_dataset); 46 47 } // namespace data 48 } // namespace tensorflow 49 50 #endif // TENSORFLOW_CORE_KERNELS_DATA_WINDOW_DATASET_H_ 51