| 40 | using type = std::tuple<TensorShape, Coordinates, Coordinates>; |
| 41 | |
| 42 | struct iterator |
| 43 | { |
| 44 | iterator(std::vector<TensorShape>::const_iterator tensor_shapes_it, |
| 45 | std::vector<Coordinates>::const_iterator starts_values_it, |
| 46 | std::vector<Coordinates>::const_iterator ends_values_it) |
| 47 | : _tensor_shapes_it{std::move(tensor_shapes_it)}, |
| 48 | _starts_values_it{std::move(starts_values_it)}, |
| 49 | _ends_values_it{std::move(ends_values_it)} |
| 50 | { |
| 51 | } |
| 52 | |
| 53 | std::string description() const |
| 54 | { |
| 55 | std::stringstream description; |
| 56 | description << "Shape=" << *_tensor_shapes_it << ":"; |
| 57 | description << "Starts=" << *_starts_values_it << ":"; |
| 58 | description << "Ends=" << *_ends_values_it << ":"; |
| 59 | return description.str(); |
| 60 | } |
| 61 | |
| 62 | SliceDataset::type operator*() const |
| 63 | { |
| 64 | return std::make_tuple(*_tensor_shapes_it, *_starts_values_it, *_ends_values_it); |
| 65 | } |
| 66 | |
| 67 | iterator &operator++() |
| 68 | { |
| 69 | ++_tensor_shapes_it; |
| 70 | ++_starts_values_it; |
| 71 | ++_ends_values_it; |
| 72 | return *this; |
| 73 | } |
| 74 | |
| 75 | private: |
| 76 | std::vector<TensorShape>::const_iterator _tensor_shapes_it; |
| 77 | std::vector<Coordinates>::const_iterator _starts_values_it; |
| 78 | std::vector<Coordinates>::const_iterator _ends_values_it; |
| 79 | }; |
| 80 | |
| 81 | iterator begin() const |
| 82 | { |