forked from wala/ML
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add initial test. * Fix whitespace. * Redo tf.data.Dataset.from_tensor_slices(). Make it more Object-Oriented rather than procedural. * Remove newline. * Forget about `from_tensor_slices()` for now. Instead, use the `Dataset()` ctor directly. It's not legal, because somehow that ctor isn't publicly accessible. But, doing so may give us a feel of how we can integrate the dataset operation chaining. * Spelling. * Split use and declaration. * This makes more sense to me. * The type should be a dataset. * Consider transformations as "reading datasets." This is because trampolines aren't easily summarized. * Stick to defintion instead of creation for now. * Add back tensor slices. * Apply spotless.
- Loading branch information
Showing
6 changed files
with
87 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import tensorflow as tf | ||
|
||
|
||
def add(a, b): | ||
return a + b | ||
|
||
|
||
dataset = tf.data.Dataset.from_tensor_slices([1, 2, 3]).shuffle(3) | ||
|
||
for element in dataset: | ||
c = add(element, element) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import tensorflow as tf | ||
|
||
|
||
def add(a, b): | ||
return a + b | ||
|
||
|
||
dataset = tf.data.Dataset(None) # This is actually illegal since this ctor is not publicly visible. | ||
|
||
for element in dataset: | ||
c = add(element, element) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import tensorflow as tf | ||
|
||
|
||
def add(a, b): | ||
return a + b | ||
|
||
|
||
dataset = tf.data.Dataset(None).shuffle(3) # This is actually illegal since this ctor is not publicly visible. | ||
|
||
for element in dataset: | ||
c = add(element, element) |