Skip to content

Commit

Permalink
Adding second level APIs (#81)
Browse files Browse the repository at this point in the history
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
tatianacv committed Jul 2, 2023
1 parent 2aff5fd commit d2cbc66
Show file tree
Hide file tree
Showing 66 changed files with 837 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,69 @@ public void testTf2()
// TODO: Uncomment below test when https://github.com/wala/ML/issues/65 is fixed.
// testTf2("tf2s.py", "add", 2, 3, 2, 3);
testTf2("tf2t.py", "add", 2, 3, 2, 3);
testTf2("tf2u.py", "add", 2, 3, 2, 3);
testTf2("tf2u2.py", "add", 2, 3, 2, 3);
testTf2("tf2u3.py", "add", 2, 3, 2, 3);
testTf2("tf2v.py", "add", 2, 3, 2, 3);
testTf2("tf2v2.py", "add", 2, 3, 2, 3);
testTf2("tf2v3.py", "add", 2, 3, 2, 3);
testTf2("tf2v4.py", "add", 2, 4, 2, 3);
testTf2("tf2v5.py", "add", 2, 4, 2, 3);
testTf2("tf2w.py", "add", 2, 3, 2, 3);
testTf2("tf2w2.py", "add", 2, 3, 2, 3);
testTf2("tf2w3.py", "add", 2, 3, 2, 3);
testTf2("tf2w4.py", "add", 2, 3, 2, 3);
testTf2("tf2x.py", "add", 2, 3, 2, 3);
testTf2("tf2x2.py", "add", 2, 3, 2, 3);
testTf2("tf2x3.py", "add", 2, 3, 2, 3);
testTf2("tf2y.py", "add", 2, 3, 2, 3);
testTf2("tf2y2.py", "add", 2, 3, 2, 3);
testTf2("tf2y3.py", "add", 2, 3, 2, 3);
testTf2("tf2y4.py", "add", 2, 3, 2, 3);
testTf2("tf2y5.py", "add", 2, 3, 2, 3);
testTf2("tf2y6.py", "add", 2, 3, 2, 3);
testTf2("tf2z.py", "add", 2, 5, 2, 3);
testTf2("tf2z2.py", "add", 2, 5, 2, 3);
testTf2("tf2z3.py", "add", 2, 5, 2, 3);
testTf2("tf2z4.py", "add", 2, 5, 2, 3);
testTf2("tf2aa.py", "add", 2, 3, 2, 3);
testTf2("tf2aa2.py", "add", 2, 3, 2, 3);
testTf2("tf2aa3.py", "add", 2, 3, 2, 3);
testTf2("tf2aa4.py", "add", 2, 3, 2, 3);
testTf2("tf2aa5.py", "add", 2, 3, 2, 3);
testTf2("tf2aa6.py", "add", 2, 3, 2, 3);
testTf2("tf2aa7.py", "add", 2, 3, 2, 3);
testTf2("tf2aa8.py", "add", 2, 3, 2, 3);
testTf2("tf2bb.py", "add", 2, 5, 2, 3);
testTf2("tf2bb2.py", "add", 2, 5, 2, 3);
testTf2("tf2bb3.py", "add", 2, 5, 2, 3);
testTf2("tf2bb4.py", "add", 2, 5, 2, 3);
testTf2("tf2cc.py", "add", 2, 3, 2, 3);
testTf2("tf2cc2.py", "add", 2, 3, 2, 3);
testTf2("tf2cc3.py", "add", 2, 3, 2, 3);
testTf2("tf2dd.py", "add", 2, 3, 2, 3);
testTf2("tf2dd2.py", "add", 2, 3, 2, 3);
testTf2("tf2ee.py", "add", 2, 3, 2, 3);
testTf2("tf2ee2.py", "add", 2, 3, 2, 3);
testTf2("tf2ff.py", "add", 2, 3, 2, 3);
testTf2("tf2ff2.py", "add", 2, 3, 2, 3);
testTf2("tf2gg.py", "add", 2, 3, 2, 3);
testTf2("tf2gg2.py", "add", 2, 3, 2, 3);
testTf2("tf2gg3.py", "add", 2, 3, 2, 3);
testTf2("tf2hh.py", "add", 2, 3, 2, 3);
testTf2("tf2hh2.py", "add", 2, 3, 2, 3);
testTf2("tf2hh3.py", "add", 2, 3, 2, 3);
testTf2("tf2hh4.py", "add", 2, 3, 2, 3);
testTf2("tf2ii.py", "add", 2, 3, 2, 3);
testTf2("tf2ii2.py", "add", 2, 3, 2, 3);
testTf2("tf2ii3.py", "add", 2, 3, 2, 3);
testTf2("tf2jj.py", "add", 2, 3, 2, 3);
testTf2("tf2jj2.py", "add", 2, 3, 2, 3);
testTf2("tf2kk.py", "add", 2, 3, 2, 3);
testTf2("tf2kk2.py", "add", 2, 3, 2, 3);
testTf2("tf2ll.py", "add", 2, 3, 2, 3);
testTf2("tf2ll2.py", "add", 2, 3, 2, 3);
testTf2("tf2ll3.py", "add", 2, 3, 2, 3);
}

private void testTf2(
Expand Down
292 changes: 292 additions & 0 deletions com.ibm.wala.cast.python.ml/data/tensorflow.xml

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions com.ibm.wala.cast.python.test/data/tf2aa.py
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])))
7 changes: 7 additions & 0 deletions com.ibm.wala.cast.python.test/data/tf2aa2.py
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])))
7 changes: 7 additions & 0 deletions com.ibm.wala.cast.python.test/data/tf2aa3.py
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])))
8 changes: 8 additions & 0 deletions com.ibm.wala.cast.python.test/data/tf2aa4.py
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])))
7 changes: 7 additions & 0 deletions com.ibm.wala.cast.python.test/data/tf2aa5.py
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])))
7 changes: 7 additions & 0 deletions com.ibm.wala.cast.python.test/data/tf2aa6.py
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])))
7 changes: 7 additions & 0 deletions com.ibm.wala.cast.python.test/data/tf2aa7.py
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])))
7 changes: 7 additions & 0 deletions com.ibm.wala.cast.python.test/data/tf2aa8.py
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])))
9 changes: 9 additions & 0 deletions com.ibm.wala.cast.python.test/data/tf2bb.py
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))
9 changes: 9 additions & 0 deletions com.ibm.wala.cast.python.test/data/tf2bb2.py
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))
10 changes: 10 additions & 0 deletions com.ibm.wala.cast.python.test/data/tf2bb3.py
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))
10 changes: 10 additions & 0 deletions com.ibm.wala.cast.python.test/data/tf2bb4.py
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))
7 changes: 7 additions & 0 deletions com.ibm.wala.cast.python.test/data/tf2cc.py
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]))
8 changes: 8 additions & 0 deletions com.ibm.wala.cast.python.test/data/tf2cc2.py
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]))
7 changes: 7 additions & 0 deletions com.ibm.wala.cast.python.test/data/tf2cc3.py
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]))
7 changes: 7 additions & 0 deletions com.ibm.wala.cast.python.test/data/tf2dd.py
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]))
8 changes: 8 additions & 0 deletions com.ibm.wala.cast.python.test/data/tf2dd2.py
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]))
7 changes: 7 additions & 0 deletions com.ibm.wala.cast.python.test/data/tf2ee.py
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]))
8 changes: 8 additions & 0 deletions com.ibm.wala.cast.python.test/data/tf2ee2.py
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]))
7 changes: 7 additions & 0 deletions com.ibm.wala.cast.python.test/data/tf2ff.py
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]))
8 changes: 8 additions & 0 deletions com.ibm.wala.cast.python.test/data/tf2ff2.py
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]))
7 changes: 7 additions & 0 deletions com.ibm.wala.cast.python.test/data/tf2gg.py
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]))
8 changes: 8 additions & 0 deletions com.ibm.wala.cast.python.test/data/tf2gg2.py
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]))
7 changes: 7 additions & 0 deletions com.ibm.wala.cast.python.test/data/tf2gg3.py
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]))
7 changes: 7 additions & 0 deletions com.ibm.wala.cast.python.test/data/tf2hh.py
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]))
7 changes: 7 additions & 0 deletions com.ibm.wala.cast.python.test/data/tf2hh2.py
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]))
8 changes: 8 additions & 0 deletions com.ibm.wala.cast.python.test/data/tf2hh3.py
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]))
8 changes: 8 additions & 0 deletions com.ibm.wala.cast.python.test/data/tf2hh4.py
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]))
7 changes: 7 additions & 0 deletions com.ibm.wala.cast.python.test/data/tf2ii.py
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))
7 changes: 7 additions & 0 deletions com.ibm.wala.cast.python.test/data/tf2ii2.py
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))
9 changes: 9 additions & 0 deletions com.ibm.wala.cast.python.test/data/tf2ii3.py
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))
7 changes: 7 additions & 0 deletions com.ibm.wala.cast.python.test/data/tf2jj.py
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]))
8 changes: 8 additions & 0 deletions com.ibm.wala.cast.python.test/data/tf2jj2.py
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]))
7 changes: 7 additions & 0 deletions com.ibm.wala.cast.python.test/data/tf2kk.py
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))
8 changes: 8 additions & 0 deletions com.ibm.wala.cast.python.test/data/tf2kk2.py
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))
7 changes: 7 additions & 0 deletions com.ibm.wala.cast.python.test/data/tf2ll.py
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))
8 changes: 8 additions & 0 deletions com.ibm.wala.cast.python.test/data/tf2ll2.py
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))
9 changes: 9 additions & 0 deletions com.ibm.wala.cast.python.test/data/tf2ll3.py
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))
Loading

0 comments on commit d2cbc66

Please sign in to comment.