Skip to content

Commit 251db55

Browse files
committed
Start of log sink mapping
Signed-off-by: Ryan Nett <[email protected]>
1 parent 8f9107d commit 251db55

File tree

11 files changed

+1445
-8
lines changed

11 files changed

+1445
-8
lines changed

tensorflow-core/tensorflow-core-api/pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,8 @@
212212
<includePaths>
213213
<includePath>${project.basedir}/</includePath>
214214
<includePath>${project.basedir}/bazel-${project.artifactId}/external/org_tensorflow/</includePath>
215+
<includePath>${project.basedir}/bazel-${project.artifactId}/external/com_google_absl/</includePath>
216+
<includePath>${project.basedir}/bazel-${project.artifactId}/external/eigen_archive/</includePath>
215217
</includePaths>
216218
<linkPaths>
217219
<linkPath>${project.basedir}/bazel-bin/external/llvm_openmp/</linkPath>

tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/DataOps.java

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,25 @@
1818
package org.tensorflow.op;
1919

2020
import java.util.List;
21+
import org.tensorflow.ConcreteFunction;
2122
import org.tensorflow.Operand;
2223
import org.tensorflow.ndarray.Shape;
2324
import org.tensorflow.op.data.AnonymousIterator;
2425
import org.tensorflow.op.data.BatchDataset;
2526
import org.tensorflow.op.data.ConcatenateDataset;
2627
import org.tensorflow.op.data.DeleteIterator;
2728
import org.tensorflow.op.data.DeserializeIterator;
29+
import org.tensorflow.op.data.FilterDataset;
30+
import org.tensorflow.op.data.FlatMapDataset;
31+
import org.tensorflow.op.data.InterleaveDataset;
2832
import org.tensorflow.op.data.Iterator;
2933
import org.tensorflow.op.data.IteratorGetNext;
3034
import org.tensorflow.op.data.IteratorGetNextAsOptional;
3135
import org.tensorflow.op.data.IteratorGetNextSync;
3236
import org.tensorflow.op.data.IteratorToStringHandle;
3337
import org.tensorflow.op.data.MakeIterator;
38+
import org.tensorflow.op.data.MapDataset;
39+
import org.tensorflow.op.data.OneShotIterator;
3440
import org.tensorflow.op.data.OptionalFromValue;
3541
import org.tensorflow.op.data.OptionalGetValue;
3642
import org.tensorflow.op.data.OptionalHasValue;
@@ -134,6 +140,75 @@ public DeserializeIterator deserializeIterator(Operand<? extends TType> resource
134140
return DeserializeIterator.create(scope, resourceHandle, serialized);
135141
}
136142

143+
/**
144+
* Creates a dataset containing elements of {@code input_dataset} matching {@code predicate}.
145+
* The {@code predicate} function must return a scalar boolean and accept the
146+
* following arguments:
147+
* <ul>
148+
* <li>One tensor for each component of an element of {@code input_dataset}.</li>
149+
* <li>One tensor for each value in {@code other_arguments}.</li>
150+
* </ul>
151+
*
152+
* @param inputDataset the inputDataset value
153+
* @param otherArguments A list of tensors, typically values that were captured when
154+
* building a closure for {@code predicate}.
155+
* @param predicate A function returning a scalar boolean.
156+
* @param outputTypes the value of the outputTypes property
157+
* @param outputShapes the value of the outputShapes property
158+
* @return a new instance of FilterDataset
159+
*/
160+
public FilterDataset filterDataset(Operand<? extends TType> inputDataset,
161+
Iterable<Operand<?>> otherArguments, ConcreteFunction predicate,
162+
List<Class<? extends TType>> outputTypes, List<Shape> outputShapes) {
163+
return FilterDataset.create(scope, inputDataset, otherArguments, predicate, outputTypes, outputShapes);
164+
}
165+
166+
/**
167+
* Creates a dataset that applies {@code f} to the outputs of {@code input_dataset}.
168+
* Unlike MapDataset, the {@code f} in FlatMapDataset is expected to return a
169+
* Dataset variant, and FlatMapDataset will flatten successive results
170+
* into a single Dataset.
171+
*
172+
* @param inputDataset the inputDataset value
173+
* @param otherArguments the otherArguments value
174+
* @param f A function mapping elements of {@code input_dataset}, concatenated with
175+
* {@code other_arguments}, to a Dataset variant that contains elements matching
176+
* {@code output_types} and {@code output_shapes}.
177+
* @param outputTypes the value of the outputTypes property
178+
* @param outputShapes the value of the outputShapes property
179+
* @return a new instance of FlatMapDataset
180+
*/
181+
public FlatMapDataset flatMapDataset(Operand<? extends TType> inputDataset,
182+
Iterable<Operand<?>> otherArguments, ConcreteFunction f,
183+
List<Class<? extends TType>> outputTypes, List<Shape> outputShapes) {
184+
return FlatMapDataset.create(scope, inputDataset, otherArguments, f, outputTypes, outputShapes);
185+
}
186+
187+
/**
188+
* Creates a dataset that applies {@code f} to the outputs of {@code input_dataset}.
189+
* Unlike MapDataset, the {@code f} in InterleaveDataset is expected to return
190+
* a Dataset variant, and InterleaveDataset will flatten successive
191+
* results into a single Dataset. Unlike FlatMapDataset,
192+
* InterleaveDataset will interleave sequences of up to {@code block_length}
193+
* consecutive elements from {@code cycle_length} input elements.
194+
*
195+
* @param inputDataset the inputDataset value
196+
* @param otherArguments the otherArguments value
197+
* @param cycleLength the cycleLength value
198+
* @param blockLength the blockLength value
199+
* @param f A function mapping elements of {@code input_dataset}, concatenated with
200+
* {@code other_arguments}, to a Dataset variant that contains elements matching
201+
* {@code output_types} and {@code output_shapes}.
202+
* @param outputTypes the value of the outputTypes property
203+
* @param outputShapes the value of the outputShapes property
204+
* @return a new instance of InterleaveDataset
205+
*/
206+
public InterleaveDataset interleaveDataset(Operand<? extends TType> inputDataset,
207+
Iterable<Operand<?>> otherArguments, Operand<TInt64> cycleLength, Operand<TInt64> blockLength,
208+
ConcreteFunction f, List<Class<? extends TType>> outputTypes, List<Shape> outputShapes) {
209+
return InterleaveDataset.create(scope, inputDataset, otherArguments, cycleLength, blockLength, f, outputTypes, outputShapes);
210+
}
211+
137212
/**
138213
* The IteratorV2 operation
139214
*
@@ -215,6 +290,56 @@ public MakeIterator makeIterator(Operand<? extends TType> dataset,
215290
return MakeIterator.create(scope, dataset, iterator);
216291
}
217292

293+
/**
294+
* Creates a dataset that applies {@code f} to the outputs of {@code input_dataset}.
295+
*
296+
* @param inputDataset the inputDataset value
297+
* @param otherArguments the otherArguments value
298+
* @param f the value of the f property
299+
* @param outputTypes the value of the outputTypes property
300+
* @param outputShapes the value of the outputShapes property
301+
* @param options carries optional attribute values
302+
* @return a new instance of MapDataset
303+
*/
304+
public MapDataset mapDataset(Operand<? extends TType> inputDataset,
305+
Iterable<Operand<?>> otherArguments, ConcreteFunction f,
306+
List<Class<? extends TType>> outputTypes, List<Shape> outputShapes,
307+
MapDataset.Options... options) {
308+
return MapDataset.create(scope, inputDataset, otherArguments, f, outputTypes, outputShapes, options);
309+
}
310+
311+
/**
312+
* Makes a &quot;one-shot&quot; iterator that can be iterated only once.
313+
* A one-shot iterator bundles the logic for defining the dataset and
314+
* the state of the iterator in a single op, which allows simple input
315+
* pipelines to be defined without an additional initialization
316+
* (&quot;MakeIterator&quot;) step.
317+
* <p>One-shot iterators have the following limitations:
318+
* <ul>
319+
* <li>They do not support parameterization: all logic for creating the underlying
320+
* dataset must be bundled in the {@code dataset_factory} function.</li>
321+
* <li>They are not resettable. Once a one-shot iterator reaches the end of its
322+
* underlying dataset, subsequent &quot;IteratorGetNext&quot; operations on that
323+
* iterator will always produce an {@code OutOfRange} error.</li>
324+
* </ul>
325+
* <p>For greater flexibility, use &quot;Iterator&quot; and &quot;MakeIterator&quot; to define
326+
* an iterator using an arbitrary subgraph, which may capture tensors
327+
* (including fed values) as parameters, and which may be reset multiple
328+
* times by rerunning &quot;MakeIterator&quot;.
329+
*
330+
* @param datasetFactory A function of type {@code () -> DT_VARIANT}, where the returned
331+
* DT_VARIANT is a dataset.
332+
* @param outputTypes the value of the outputTypes property
333+
* @param outputShapes the value of the outputShapes property
334+
* @param options carries optional attribute values
335+
* @return a new instance of OneShotIterator
336+
*/
337+
public OneShotIterator oneShotIterator(ConcreteFunction datasetFactory,
338+
List<Class<? extends TType>> outputTypes, List<Shape> outputShapes,
339+
OneShotIterator.Options... options) {
340+
return OneShotIterator.create(scope, datasetFactory, outputTypes, outputShapes, options);
341+
}
342+
218343
/**
219344
* Constructs an Optional variant from a tuple of tensors.
220345
*

0 commit comments

Comments
 (0)