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.
Adding second-level APIs with their respective tests, which can be found at: https://github.com/ponder-lab/Hybridize-Functions-Refactoring/wiki/TF2-tensor-generators.
- Loading branch information
Showing
66 changed files
with
837 additions
and
0 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
Large diffs are not rendered by default.
Oops, something went wrong.
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,7 @@ | ||
import tensorflow as tf | ||
|
||
def add(a, b): | ||
return a + b | ||
|
||
|
||
c = add(tf.RaggedTensor.from_nested_row_splits([3, 1, 4, 1, 5, 9, 2, 6],([0, 3, 3, 5], [0, 4, 4, 7, 8, 8])),tf.RaggedTensor.from_nested_row_splits([13, 1, 4, 1, 15, 9, 2, 16],([0, 3, 3, 5], [0, 4, 4, 7, 8, 8]))) |
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,7 @@ | ||
import tensorflow | ||
|
||
def add(a, b): | ||
return a + b | ||
|
||
|
||
c = add(tensorflow.RaggedTensor.from_nested_row_splits([3, 1, 4, 1, 5, 9, 2, 6],([0, 3, 3, 5], [0, 4, 4, 7, 8, 8])),tensorflow.RaggedTensor.from_nested_row_splits([13, 1, 4, 1, 15, 9, 2, 16],([0, 3, 3, 5], [0, 4, 4, 7, 8, 8]))) |
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,7 @@ | ||
from tensorflow.python.ops.ragged.ragged_tensor import RaggedTensor | ||
|
||
def add(a, b): | ||
return a + b | ||
|
||
|
||
c = add(RaggedTensor.from_nested_row_splits([3, 1, 4, 1, 5, 9, 2, 6],([0, 3, 3, 5], [0, 4, 4, 7, 8, 8])),RaggedTensor.from_nested_row_splits([13, 1, 4, 1, 15, 9, 2, 16],([0, 3, 3, 5], [0, 4, 4, 7, 8, 8]))) |
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,8 @@ | ||
from tensorflow.python.ops.ragged.ragged_tensor import RaggedTensor | ||
import tensorflow as tf | ||
|
||
def add(a, b): | ||
return a + b | ||
|
||
|
||
c = add(tf.RaggedTensor.from_nested_row_splits([3, 1, 4, 1, 5, 9, 2, 6],([0, 3, 3, 5], [0, 4, 4, 7, 8, 8])),RaggedTensor.from_nested_row_splits([13, 1, 4, 1, 15, 9, 2, 16],([0, 3, 3, 5], [0, 4, 4, 7, 8, 8]))) |
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,7 @@ | ||
from tensorflow.python.ops.ragged import ragged_tensor | ||
|
||
def add(a, b): | ||
return a + b | ||
|
||
|
||
c = add(ragged_tensor.RaggedTensor.from_nested_row_splits([3, 1, 4, 1, 5, 9, 2, 6],([0, 3, 3, 5], [0, 4, 4, 7, 8, 8])),ragged_tensor.RaggedTensor.from_nested_row_splits([13, 1, 4, 1, 15, 9, 2, 16],([0, 3, 3, 5], [0, 4, 4, 7, 8, 8]))) |
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,7 @@ | ||
from tensorflow.python.ops import ragged | ||
|
||
def add(a, b): | ||
return a + b | ||
|
||
|
||
c = add(ragged.ragged_tensor.RaggedTensor.from_nested_row_splits([3, 1, 4, 1, 5, 9, 2, 6],([0, 3, 3, 5], [0, 4, 4, 7, 8, 8])),ragged.ragged_tensor.RaggedTensor.from_nested_row_splits([13, 1, 4, 1, 15, 9, 2, 16],([0, 3, 3, 5], [0, 4, 4, 7, 8, 8]))) |
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,7 @@ | ||
from tensorflow.python import ops | ||
|
||
def add(a, b): | ||
return a + b | ||
|
||
|
||
c = add(ops.ragged.ragged_tensor.RaggedTensor.from_nested_row_splits([3, 1, 4, 1, 5, 9, 2, 6],([0, 3, 3, 5], [0, 4, 4, 7, 8, 8])),ops.ragged.ragged_tensor.RaggedTensor.from_nested_row_splits([13, 1, 4, 1, 15, 9, 2, 16],([0, 3, 3, 5], [0, 4, 4, 7, 8, 8]))) |
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,7 @@ | ||
from tensorflow import python | ||
|
||
def add(a, b): | ||
return a + b | ||
|
||
|
||
c = add(python.ops.ragged.ragged_tensor.RaggedTensor.from_nested_row_splits([3, 1, 4, 1, 5, 9, 2, 6],([0, 3, 3, 5], [0, 4, 4, 7, 8, 8])),python.ops.ragged.ragged_tensor.RaggedTensor.from_nested_row_splits([13, 1, 4, 1, 15, 9, 2, 16],([0, 3, 3, 5], [0, 4, 4, 7, 8, 8]))) |
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,9 @@ | ||
import tensorflow as tf | ||
|
||
def add(a, b): | ||
return a + b | ||
|
||
|
||
nested_value_rowids = [tf.constant([0, 0, 1, 3, 3], tf.int64),tf.constant([0, 0, 2, 2, 2, 3, 4], tf.int64)] | ||
x = tf.keras.Input(shape=[None], dtype=tf.string) | ||
c = add(tf.RaggedTensor.from_nested_value_rowids(x, nested_value_rowids),tf.RaggedTensor.from_nested_value_rowids(x, nested_value_rowids)) |
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,9 @@ | ||
import tensorflow | ||
|
||
def add(a, b): | ||
return a + b | ||
|
||
|
||
nested_value_rowids = [tensorflow.constant([0, 0, 1, 3, 3], tensorflow.int64),tensorflow.constant([0, 0, 2, 2, 2, 3, 4], tensorflow.int64)] | ||
x = tensorflow.keras.Input(shape=[None], dtype=tensorflow.string) | ||
c = add(tensorflow.RaggedTensor.from_nested_value_rowids(x, nested_value_rowids),tensorflow.RaggedTensor.from_nested_value_rowids(x, nested_value_rowids)) |
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,10 @@ | ||
from tensorflow.python.ops.ragged.ragged_tensor import RaggedTensor | ||
import tensorflow as tf | ||
|
||
def add(a, b): | ||
return a + b | ||
|
||
|
||
nested_value_rowids = [tf.constant([0, 0, 1, 3, 3], tf.int64),tf.constant([0, 0, 2, 2, 2, 3, 4], tf.int64)] | ||
x = tf.keras.Input(shape=[None], dtype=tf.string) | ||
c = add(RaggedTensor.from_nested_value_rowids(x, nested_value_rowids),RaggedTensor.from_nested_value_rowids(x, nested_value_rowids)) |
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,10 @@ | ||
from tensorflow.python.ops.ragged.ragged_tensor import RaggedTensor | ||
import tensorflow as tf | ||
|
||
def add(a, b): | ||
return a + b | ||
|
||
|
||
nested_value_rowids = [tf.constant([0, 0, 1, 3, 3], tf.int64),tf.constant([0, 0, 2, 2, 2, 3, 4], tf.int64)] | ||
x = tf.keras.Input(shape=[None], dtype=tf.string) | ||
c = add(tf.RaggedTensor.from_nested_value_rowids(x, nested_value_rowids),RaggedTensor.from_nested_value_rowids(x, nested_value_rowids)) |
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,7 @@ | ||
import tensorflow as tf | ||
|
||
def add(a, b): | ||
return a + b | ||
|
||
|
||
c = add(tf.RaggedTensor.from_row_lengths([3, 1, 4, 1, 5, 9, 2, 6], [4, 0, 3, 1, 0]), tf.RaggedTensor.from_row_lengths([3, 11, 4, 11, 5, 19, 21, 6], [4, 0, 3, 1, 0])) |
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,8 @@ | ||
import tensorflow as tf | ||
from tensorflow.python.ops.ragged.ragged_tensor import RaggedTensor | ||
|
||
def add(a, b): | ||
return a + b | ||
|
||
|
||
c = add(tf.RaggedTensor.from_row_lengths([3, 1, 4, 1, 5, 9, 2, 6], [4, 0, 3, 1, 0]), RaggedTensor.from_row_lengths([3, 11, 4, 11, 5, 19, 21, 6], [4, 0, 3, 1, 0])) |
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,7 @@ | ||
from tensorflow import RaggedTensor | ||
|
||
def add(a, b): | ||
return a + b | ||
|
||
|
||
c = add(RaggedTensor.from_row_lengths([3, 1, 4, 1, 5, 9, 2, 6], [4, 0, 3, 1, 0]), RaggedTensor.from_row_lengths([3, 11, 4, 11, 5, 19, 21, 6], [4, 0, 3, 1, 0])) |
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,7 @@ | ||
import tensorflow as tf | ||
|
||
def add(a, b): | ||
return a + b | ||
|
||
|
||
c = add(tf.RaggedTensor.from_row_limits([3, 1, 4, 1, 5, 9, 2, 6], [4, 4, 7, 8, 8]), tf.RaggedTensor.from_row_limits([3, 11, 4, 11, 5, 19, 21, 6], [4, 4, 7, 8, 8])) |
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,8 @@ | ||
import tensorflow as tf | ||
from tensorflow.python.ops.ragged.ragged_tensor import RaggedTensor | ||
|
||
def add(a, b): | ||
return a + b | ||
|
||
|
||
c = add(tf.RaggedTensor.from_row_limits([3, 1, 4, 1, 5, 9, 2, 6], [4, 4, 7, 8, 8]), RaggedTensor.from_row_limits([3, 11, 4, 11, 5, 19, 21, 6], [4, 4, 7, 8, 8])) |
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,7 @@ | ||
import tensorflow as tf | ||
|
||
def add(a, b): | ||
return a + b | ||
|
||
|
||
c = add(tf.RaggedTensor.from_row_splits([3, 1, 4, 1, 5, 9, 2, 6], [0, 4, 4, 7, 8, 8]), tf.RaggedTensor.from_row_splits([2, 3, 7, 17, 8, 19, 2, 6], [0, 4, 4, 7, 8, 8])) |
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,8 @@ | ||
import tensorflow as tf | ||
from tensorflow.python.ops.ragged.ragged_tensor import RaggedTensor | ||
|
||
def add(a, b): | ||
return a + b | ||
|
||
|
||
c = add(tf.RaggedTensor.from_row_splits([3, 1, 4, 1, 5, 9, 2, 6], [0, 4, 4, 7, 8, 8]), RaggedTensor.from_row_splits([2, 3, 7, 17, 8, 19, 2, 6], [0, 4, 4, 7, 8, 8])) |
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,7 @@ | ||
import tensorflow as tf | ||
|
||
def add(a, b): | ||
return a + b | ||
|
||
|
||
c = add(tf.RaggedTensor.from_row_starts([3, 1, 4, 1, 5, 9, 2, 6], [0, 4, 4, 7, 8]), tf.RaggedTensor.from_row_starts([3, 11, 4, 11, 5, 19, 21, 6], [0, 4, 4, 7, 8])) |
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,8 @@ | ||
import tensorflow as tf | ||
from tensorflow.python.ops.ragged.ragged_tensor import RaggedTensor | ||
|
||
def add(a, b): | ||
return a + b | ||
|
||
|
||
c = add(tf.RaggedTensor.from_row_starts([3, 1, 4, 1, 5, 9, 2, 6], [0, 4, 4, 7, 8]), RaggedTensor.from_row_starts([3, 11, 4, 11, 5, 19, 21, 6], [0, 4, 4, 7, 8])) |
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,7 @@ | ||
import tensorflow as tf | ||
|
||
def add(a, b): | ||
return a + b | ||
|
||
|
||
c = add(tf.RaggedTensor.from_value_rowids([3, 1, 4, 1, 5, 9, 2, 6],[0, 0, 0, 0, 2, 2, 2, 3]), tf.RaggedTensor.from_value_rowids([3, 1, 14, 1, 5, 19, 2, 16],[0, 0, 0, 0, 2, 2, 2, 3])) |
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,8 @@ | ||
import tensorflow as tf | ||
from tensorflow.python.ops.ragged.ragged_tensor import RaggedTensor | ||
|
||
def add(a, b): | ||
return a + b | ||
|
||
|
||
c = add(tf.RaggedTensor.from_value_rowids([3, 1, 4, 1, 5, 9, 2, 6],[0, 0, 0, 0, 2, 2, 2, 3]), RaggedTensor.from_value_rowids([3, 1, 14, 1, 5, 19, 2, 16],[0, 0, 0, 0, 2, 2, 2, 3])) |
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,7 @@ | ||
from tensorflow.python.ops.ragged.ragged_tensor import RaggedTensor | ||
|
||
def add(a, b): | ||
return a + b | ||
|
||
|
||
c = add(RaggedTensor.from_value_rowids([3, 1, 4, 1, 5, 9, 2, 6],[0, 0, 0, 0, 2, 2, 2, 3]), RaggedTensor.from_value_rowids([3, 1, 14, 1, 5, 19, 2, 16],[0, 0, 0, 0, 2, 2, 2, 3])) |
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,7 @@ | ||
import tensorflow as tf | ||
|
||
def add(a, b): | ||
return a + b | ||
|
||
|
||
c = add(tf.random.gamma([10], [0.5, 1.5]), tf.random.gamma([10], [1, 2.5])) |
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,7 @@ | ||
from tensorflow import random | ||
|
||
def add(a, b): | ||
return a + b | ||
|
||
|
||
c = add(random.gamma([10], [0.5, 1.5]), random.gamma([10], [1, 2.5])) |
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,8 @@ | ||
from tensorflow.python.ops.random_ops import random_gamma | ||
import tensorflow as tf | ||
|
||
def add(a, b): | ||
return a + b | ||
|
||
|
||
c = add(tf.random.gamma([10], [0.5, 1.5]), random_gamma([10], [1, 2.5])) |
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,8 @@ | ||
from tensorflow.python.ops.random_ops import random_gamma | ||
from tensorflow import random | ||
|
||
def add(a, b): | ||
return a + b | ||
|
||
|
||
c = add(random.gamma([10], [0.5, 1.5]), random_gamma([10], [1, 2.5])) |
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,7 @@ | ||
import tensorflow as tf | ||
|
||
def add(a, b): | ||
return a + b | ||
|
||
|
||
c = add(tf.random.normal([4], 0, 1, tf.float32), tf.random.normal([4], 2, 1, tf.float32)) |
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,7 @@ | ||
import tensorflow as tensors | ||
|
||
def add(a, b): | ||
return a + b | ||
|
||
|
||
c = add(tensors.random.normal([4], 0, 1, tensors.float32), tensors.random.normal([4], 2, 1, tensors.float32)) |
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,9 @@ | ||
from tensorflow import random | ||
from tensorflow.python.ops.random_ops import random_normal | ||
import tensorflow as tf | ||
|
||
def add(a, b): | ||
return a + b | ||
|
||
|
||
c = add(random.normal([4], 0, 1, tf.float32), random_normal([4], 2, 1, tf.float32)) |
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,7 @@ | ||
import tensorflow as tf | ||
|
||
def add(a, b): | ||
return a + b | ||
|
||
|
||
c = add(tf.random.poisson([10], [0.5, 1.5]), tf.random.poisson([10], [1, 2.5])) |
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,8 @@ | ||
from tensorflow import random | ||
from tensorflow.python.ops.random_ops import random_poisson_v2 | ||
|
||
def add(a, b): | ||
return a + b | ||
|
||
|
||
c = add(random.poisson([10], [0.5, 1.5]), random_poisson_v2([10], [1, 2.5])) |
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,7 @@ | ||
import tensorflow as tf | ||
|
||
def add(a, b): | ||
return a + b | ||
|
||
|
||
c = add(tf.random.truncated_normal([2]), tf.random.truncated_normal([2], 3, 1)) |
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,8 @@ | ||
from tensorflow import random | ||
from tensorflow.python.ops.random_ops import truncated_normal | ||
|
||
def add(a, b): | ||
return a + b | ||
|
||
|
||
c = add(random.truncated_normal([2]), truncated_normal([2], 3, 1)) |
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,7 @@ | ||
import tensorflow as tf | ||
|
||
def add(a, b): | ||
return tf.sparse.add(a,b) | ||
|
||
|
||
c = add(tf.sparse.eye(2,3), tf.sparse.eye(2,3)) |
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,8 @@ | ||
from tensorflow.python.ops.sparse_ops import sparse_eye | ||
import tensorflow as tf | ||
|
||
def add(a, b): | ||
return tf.sparse.add(a,b) | ||
|
||
|
||
c = add(sparse_eye(2,3), sparse_eye(2,3)) |
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,9 @@ | ||
from tensorflow.python.ops.sparse_ops import sparse_eye | ||
import tensorflow as tf | ||
from tensorflow import sparse | ||
|
||
def add(a, b): | ||
return tf.sparse.add(a,b) | ||
|
||
|
||
c = add(sparse.eye(2,3), sparse_eye(2,3)) |
Oops, something went wrong.