-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fourth-tensorflow: added + python native types
- Loading branch information
Thanirin
committed
Feb 10, 2019
1 parent
cb9c6aa
commit e89f71a
Showing
2 changed files
with
21 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import tensorflow as tf | ||
|
||
# Python native types | ||
|
||
t_0 = 19 | ||
t_1 = [b"apple", b"peach", b"grape"] | ||
|
||
t_2 = [[True, False, False], | ||
[False, False, False], | ||
[False, True, False]] | ||
|
||
with tf.Session() as session: | ||
print(session.run(tf.zeros_like(t_0))) | ||
print(session.run(tf.ones_like(t_0))) | ||
|
||
print(session.run(tf.zeros_like(t_1))) | ||
# print(session.run(tf.ones_like(t_1))) # expect string, got 1 (int) instead | ||
|
||
print(session.run(tf.zeros_like(t_2))) | ||
print(session.run(tf.ones_like(t_2))) |
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