Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
310 commits
Select commit Hold shift + click to select a range
c97cf36
Turn generator processing into a class hierarchy.
khatchad Aug 19, 2025
5cc6fb8
Split comment.
khatchad Aug 19, 2025
cff454c
Factor out some common code.
khatchad Aug 19, 2025
5c933ad
Merge branch 'master' into 267-initial-tensor-dimensions-arent-always…
khatchad Aug 20, 2025
17e64d2
Simplify test code.
khatchad Aug 20, 2025
f1c83d0
Add assertions.
khatchad Aug 20, 2025
2623d48
Simplify test code.
khatchad Aug 20, 2025
c11f9ce
Progress.
khatchad Aug 20, 2025
fcf030b
Use doubles.
khatchad Aug 20, 2025
5ceefb8
Rename.
khatchad Aug 20, 2025
7eeed8d
Factor out common code for shapes.
khatchad Aug 20, 2025
7b2dbae
Add method "implementations."
khatchad Aug 20, 2025
1509bf4
Add tests.
khatchad Aug 20, 2025
fc2d4bc
Add file.
khatchad Aug 20, 2025
a7c09e0
Add comments.
khatchad Aug 20, 2025
6c88c94
Remove TODO.
khatchad Aug 21, 2025
1088488
Comments and variable rename.
khatchad Aug 21, 2025
bc446c8
Add value number for dtype.
khatchad Aug 21, 2025
ea5205d
Return -1 for unsupported dtype arguments.
khatchad Aug 21, 2025
e161461
Rename variables.
khatchad Aug 21, 2025
6277b7c
Add docs.
khatchad Aug 21, 2025
9437259
Extract method refactoring.
khatchad Aug 21, 2025
ea949e7
Pull up method refactoring.
khatchad Aug 21, 2025
ff68dae
Extract constant refactoring.
khatchad Aug 21, 2025
0cf87cd
Format.
khatchad Aug 21, 2025
772319f
Fix https://github.com/wala/ML/issues/298.
khatchad Aug 21, 2025
a0277ee
Merge branch 'master' into 267-initial-tensor-dimensions-arent-always…
khatchad Aug 21, 2025
fc152a6
Encapsulate field refactoring.
khatchad Aug 26, 2025
c60f50a
Add assertions.
khatchad Aug 26, 2025
9060c0c
Shorten.
khatchad Aug 26, 2025
a1d1b9c
Fix comment.
khatchad Aug 26, 2025
613fbf5
Pull-up method refactoring.
khatchad Aug 26, 2025
2e1c5e8
Sort members refactoring.
khatchad Aug 26, 2025
8b72fe5
Add docs.
khatchad Aug 26, 2025
b38d460
Extract variable refactoring.
khatchad Aug 26, 2025
b2f814f
Progress.
khatchad Aug 26, 2025
949eca2
Add comment.
khatchad Aug 26, 2025
1210fbf
New test.
khatchad Aug 28, 2025
8a05bc5
New line.
khatchad Aug 28, 2025
fc13736
Merge branch 'master' into 267-initial-tensor-dimensions-arent-always…
khatchad Aug 28, 2025
d7c7b20
Format.
khatchad Aug 28, 2025
f45d1d4
Rename method.
khatchad Aug 28, 2025
8cd367e
Fix test.
khatchad Aug 28, 2025
4450b92
Revert "Rename method."
khatchad Aug 28, 2025
c92b5b2
Add metadata.
khatchad Sep 5, 2025
f3c63ce
New test.
khatchad Sep 5, 2025
fc8f4ba
Cleanup.
khatchad Sep 5, 2025
3a332c1
New test.
khatchad Sep 5, 2025
b91b2f1
Progress.
khatchad Sep 5, 2025
ada8ff6
Add test file.
khatchad Sep 5, 2025
7c28fdd
Merge branch 'master' into 267-initial-tensor-dimensions-arent-always…
khatchad Sep 8, 2025
1781fbc
Black.
khatchad Sep 8, 2025
4e46879
Add asserts.
khatchad Sep 8, 2025
c1db8f2
Add another test case.
khatchad Sep 8, 2025
02acac2
Simplify.
khatchad Sep 8, 2025
be01c4d
Progress.
khatchad Sep 8, 2025
cf80b59
Merge branch 'master' into 267-initial-tensor-dimensions-arent-always…
khatchad Sep 9, 2025
db020e0
Merge branch 'master' into 267-initial-tensor-dimensions-arent-always…
khatchad Sep 9, 2025
ecf7af9
New test.
khatchad Sep 9, 2025
86770a3
Add doc and change method names.
khatchad Sep 9, 2025
1b88e96
More tests.
khatchad Sep 9, 2025
288ded8
Remove test file.
khatchad Sep 9, 2025
911277e
Rename.
khatchad Sep 11, 2025
09a479c
Separate.
khatchad Sep 11, 2025
74b0ef4
Use API.
khatchad Sep 11, 2025
6b098bd
Add dtype inference.
khatchad Sep 11, 2025
13c7ec0
Update tests.
khatchad Sep 11, 2025
216bb9a
Add test for varying dtypes.
khatchad Sep 11, 2025
515fa5b
Add tests for https://github.com/wala/ML/issues/308.
khatchad Sep 12, 2025
d84b52a
Merge branch 'master' into 267-initial-tensor-dimensions-arent-always…
khatchad Sep 12, 2025
0f432bf
Merge branch 'master' into 267-initial-tensor-dimensions-arent-always…
khatchad Oct 14, 2025
11e08ef
Make more general.
khatchad Oct 16, 2025
d04962d
Add asserts.
khatchad Oct 16, 2025
4a001f0
Add TODO.
khatchad Oct 16, 2025
c48fb08
Move field reference to types class?
khatchad Oct 16, 2025
53f14ca
Remove author.
khatchad Oct 16, 2025
8e6534c
Fix more copyrights.
khatchad Oct 16, 2025
9f6624a
Remove unnecessary cast.
khatchad Oct 16, 2025
2ebddc1
Suppress warnings.
khatchad Oct 16, 2025
cfc19ad
Enable all warnings and show deprecated usage.
khatchad Oct 16, 2025
acf54ca
Remove (seemingly) unused property.
khatchad Oct 16, 2025
9b0a010
Use the standard main method signature.
khatchad Oct 16, 2025
ab22b00
Remove redundant cast.
khatchad Oct 16, 2025
e2d337b
Suppress warnings.
khatchad Oct 16, 2025
013e458
Upgrade to Java 25.
khatchad Oct 16, 2025
e5f9a50
Fix more copyrights.
khatchad Oct 16, 2025
de0b88f
Use Java 25 on the CI.
khatchad Oct 16, 2025
d380ed1
Add back casts.
khatchad Oct 16, 2025
6c9f645
No periods.
khatchad Oct 16, 2025
49fddfd
Bump org.apache.maven.plugins:maven-shade-plugin from 3.6.0 to 3.6.1
dependabot[bot] Sep 15, 2025
0d5927d
Merge branch 'master' into 267-initial-tensor-dimensions-arent-always…
khatchad Oct 16, 2025
e5f4a1d
More metadata for Java 25.
khatchad Oct 16, 2025
80d6ed4
Generalize dtype literal lookup and comparison.
khatchad Oct 16, 2025
9cc1b80
Fix exception.
khatchad Oct 16, 2025
6cdaed0
Fix class name.
khatchad Oct 16, 2025
ddf134c
No period.
khatchad Oct 16, 2025
eebaa5f
Capitalize.
khatchad Oct 16, 2025
31e9949
Handle `tf.random.uniform`.
khatchad Oct 16, 2025
7f62689
Merge branch 'master' into 267-initial-tensor-dimensions-arent-always…
khatchad Oct 16, 2025
fdb8738
Fix method name.
khatchad Oct 16, 2025
9e61fc1
Remove unused constants.
khatchad Oct 16, 2025
c1bfcc6
Metadata.
khatchad Oct 16, 2025
60a88c3
Zeros.
khatchad Oct 17, 2025
aa6d71b
Zeros like.
khatchad Oct 17, 2025
2cc65b9
Fix test.
khatchad Oct 17, 2025
317bd3b
Initial support for `tf.fill` operation in TensorFlow models.
khatchad Oct 20, 2025
5994380
Additional test for `tf.fill` operation in TensorFlow 2 models.
khatchad Oct 20, 2025
8b37b8d
Fix test for `tf.fill()`.
khatchad Oct 20, 2025
e265d70
Format.
khatchad Oct 20, 2025
8e6b4b2
Handle `tf.random.normal()` calls.
khatchad Oct 20, 2025
87cc3f3
Fix docs.
khatchad Oct 20, 2025
c54739d
Additional test for `tf.random.normal()`.
khatchad Oct 20, 2025
6dfa1a8
Update test.
khatchad Oct 20, 2025
2344618
Handle multiple imports.
khatchad Oct 20, 2025
2ce5856
Progress.
khatchad Oct 21, 2025
689829e
Format.
khatchad Oct 21, 2025
a442bdc
Simplify `tf.range()` handling.
khatchad Oct 21, 2025
a3ae6f9
Simplify code.
khatchad Oct 21, 2025
e513cf9
Simplify.
khatchad Oct 21, 2025
b897827
Fix number of parameters for `tf.range`.
khatchad Oct 21, 2025
319eed7
Handle multiple parameters for `tf.range()`.
khatchad Oct 21, 2025
f5b0461
Merge branch 'master' into 267-initial-tensor-dimensions-arent-always…
khatchad Oct 21, 2025
a38c764
Merge branch 'master' into 267-initial-tensor-dimensions-arent-always…
khatchad Oct 21, 2025
41950e9
Remove assertions for now.
khatchad Oct 23, 2025
69a0a89
Simplify.
khatchad Oct 23, 2025
b3f9437
Add logging.
khatchad Oct 24, 2025
1505689
Add pretty printing.
khatchad Oct 24, 2025
a867dae
Alter logging.
khatchad Oct 24, 2025
31c2acb
Update test to reflect accurate tensor dimensions.
khatchad Oct 27, 2025
d6e2a57
Merge branch 'master' into 267-initial-tensor-dimensions-arent-always…
khatchad Oct 27, 2025
c8395e6
Merge branch 'master' into 267-initial-tensor-dimensions-arent-always…
khatchad Oct 27, 2025
c6683f2
Fix `tf.range()`.
khatchad Oct 27, 2025
462ce2d
Merge branch 'master' into 267-initial-tensor-dimensions-arent-always…
khatchad Oct 27, 2025
48b7d76
Redo number of parameters.
khatchad Oct 28, 2025
dbfad35
Revert "Remove assertions for now."
khatchad Oct 28, 2025
65a947b
Properly get value numbers for Range parameters.
khatchad Oct 28, 2025
b606645
Fix filename to match test name.
khatchad Oct 28, 2025
d1e2ec5
Can't use declared number of positional parameters.
khatchad Oct 28, 2025
6c7e668
Merge branch 'master' into 267-initial-tensor-dimensions-arent-always…
khatchad Oct 28, 2025
865c17d
Merge branch 'master' into 267-initial-tensor-dimensions-arent-always…
khatchad Oct 28, 2025
8dda029
Add defensive code.
khatchad Oct 28, 2025
36ecadf
Add comment.
khatchad Oct 28, 2025
fef8b47
Merge branch 'master' into 267-initial-tensor-dimensions-arent-always…
khatchad Oct 28, 2025
b5c41d5
Improve the code?
khatchad Oct 28, 2025
98c0fea
Revert "Improve the code?"
khatchad Oct 28, 2025
daf0646
Improve code for analyzing call sites.
khatchad Oct 28, 2025
9a3977b
Lookup the value numbers of the parameters.
khatchad Oct 30, 2025
dcd3d80
Format.
khatchad Oct 30, 2025
2becd47
Remove TODO.
khatchad Oct 30, 2025
4b3d3fa
Extract method refactoring.
khatchad Oct 30, 2025
4408264
Rename methods for clarification.
khatchad Oct 30, 2025
4300986
Merge branch 'master' into 267-initial-tensor-dimensions-arent-always…
khatchad Oct 31, 2025
9913316
Progress on handling `tf.convert_to_tensor()` API in TensorFlow.
khatchad Oct 31, 2025
669a775
If tensor shapes are coming from a variable, make sure we know about it.
khatchad Nov 3, 2025
fe446d4
Spotless.
khatchad Nov 3, 2025
7322616
Add javadoc to `Fill.java`.
khatchad Nov 3, 2025
7bca757
Add assertions of tensor properties after reshape operation.
khatchad Nov 3, 2025
2cab14c
Merge branch 'master' into 267-initial-tensor-dimensions-arent-always…
khatchad Nov 3, 2025
1e0f4b4
Suppress failures for https://github.com/wala/ML/issues/340.
khatchad Nov 3, 2025
ac39410
Merge branch 'master' into 267-initial-tensor-dimensions-arent-always…
khatchad Nov 3, 2025
39f68ad
Merge branch 'master' into 267-initial-tensor-dimensions-arent-always…
khatchad Nov 6, 2025
f0c0246
Use the parameter position.
khatchad Nov 6, 2025
b3176c6
Can't get shapes from the shape argument when there is no shape argum…
khatchad Nov 6, 2025
0ce90af
Some progress on `tf.one_hot()`.
khatchad Nov 6, 2025
f5ddb83
Fix the logic.
khatchad Nov 6, 2025
86172dd
Handle the case where the passed argument is `None`.
khatchad Nov 6, 2025
26eac16
Add tests for `tf.one_hot()` with various parameters.
khatchad Nov 6, 2025
2ab1ba3
Fix logic.
khatchad Nov 6, 2025
f0c3e99
Progress.
khatchad Nov 6, 2025
c609ccb
Guard against `None`.
khatchad Nov 7, 2025
acef928
Fix exception type.
khatchad Nov 7, 2025
bf63246
Add future test.
khatchad Nov 7, 2025
a8acc8d
Switch hierarchy.
khatchad Nov 7, 2025
e6f49ed
Cleanup.
khatchad Nov 7, 2025
573f06a
Pull up `getIntValueFromInstanceKey()` to `Ones` super class.
khatchad Nov 7, 2025
ff52a09
Initial work on `tf.eye()`.
khatchad Nov 7, 2025
6d9eac5
Refine tests.
khatchad Nov 7, 2025
fc81337
Add test.
khatchad Nov 7, 2025
a98f6a7
Check required parameters.
khatchad Nov 7, 2025
3612e02
Handle batch dimensions for tf.eye().
khatchad Nov 7, 2025
834cb29
Add TODO.
khatchad Nov 7, 2025
32a8bd5
Add test.
khatchad Nov 7, 2025
6576292
Fix test.
khatchad Nov 7, 2025
2755447
Handle `tf.random.gamma`.
khatchad Nov 10, 2025
e9317ef
Merge branch 'master' into 267-initial-tensor-dimensions-arent-always…
khatchad Nov 10, 2025
62a252b
Add exceptions for missing mandatory shape parameters.
khatchad Nov 11, 2025
521fcc4
Renamed variable for clarity.
khatchad Nov 11, 2025
784fd30
Handle `tf.random.poisson` API in TensorFlow.
khatchad Nov 11, 2025
550c997
Make enums protected.
khatchad Nov 11, 2025
cb07edc
Handle `tf.sparse.eye()` in addition to `tf.eye()`.
khatchad Nov 11, 2025
ab386c0
Metadata.
khatchad Nov 15, 2025
9edba61
Fix comment.
khatchad Nov 15, 2025
ca36069
Extract method.
khatchad Nov 16, 2025
57707ef
Pull up method.
khatchad Nov 16, 2025
efa5f80
Shorten variable names.
khatchad Nov 16, 2025
e339bc5
Fix missing argument.
khatchad Nov 16, 2025
690b8dd
Allow optional parameters.
khatchad Nov 16, 2025
de7b1f7
Reuse code in `Gamma`.
khatchad Nov 16, 2025
e55de3b
Remove `node` from `TensorGenerator` and its subclasses.
khatchad Nov 24, 2025
3598eb4
Extract method to Util class.
khatchad Nov 25, 2025
58ea3b5
Add `RAGGED_CONSTANT` `MethodReference` for `tf.ragged.constant`.
khatchad Nov 25, 2025
d3d8535
Add mapping from `TypeReference` to TensorFlow signatures.
khatchad Nov 25, 2025
23aec08
Add assertions.
khatchad Nov 25, 2025
b6249a8
Some work on handling `tf.ragged.constant` correctly.
khatchad Dec 4, 2025
245bcee
Move ctor.
khatchad Dec 4, 2025
fe8c890
Static import.
khatchad Dec 4, 2025
ca110de
Add TODO about nested lists/tuples in `TensorGenerator.java`.
khatchad Dec 4, 2025
5e102b5
Forgot a file.
khatchad Dec 4, 2025
1f463b4
Merge branch 'master' into 267-initial-tensor-dimensions-arent-always…
khatchad Dec 4, 2025
fc60ced
Black.
khatchad Dec 4, 2025
5aa75be
Add test for `tf.convert_to_tensor` with 2D list input.
khatchad Dec 5, 2025
ce47fcd
Black.
khatchad Dec 5, 2025
db12fbb
Complete TODO.
khatchad Dec 5, 2025
90472b6
More tests for `RaggedConstant` handling.
khatchad Dec 5, 2025
4b0c7ea
Fix error message.
khatchad Dec 5, 2025
cb684e2
Switch parameter order in `getShapesOfValue()` calls.
khatchad Dec 5, 2025
e41f567
Revert "Switch parameter order in `getShapesOfValue()` calls."
khatchad Dec 5, 2025
e8fee35
Use static import.
khatchad Dec 5, 2025
81bac7d
Make the method protected so that subclasses can override it.
khatchad Dec 5, 2025
6f236c1
Progress on `tf.ragged.constant()` shape inference to handle ragged d…
khatchad Dec 5, 2025
e975060
Pull up the `getSignature()` method to the super class.
khatchad Dec 5, 2025
90384ce
New test.
khatchad Dec 5, 2025
9baedf4
Fix method name.
khatchad Dec 5, 2025
3daa5c5
Minor change.
khatchad Dec 5, 2025
723fd38
Progress on `tf.ragged.constant`.
khatchad Dec 6, 2025
95ce3d3
Default to `tf.float32` dtype in `RaggedConstant` when there are no
khatchad Dec 8, 2025
19fc100
Fix test.
khatchad Dec 8, 2025
44a980c
Cleanup.
khatchad Dec 8, 2025
0bbab35
Progress.
khatchad Dec 8, 2025
2dd55f1
Fix compilation error.
khatchad Dec 8, 2025
143e7f7
Progress.
khatchad Dec 9, 2025
dbe3c78
Use static import.
khatchad Dec 9, 2025
b08fe50
Progress.
khatchad Dec 9, 2025
7cd16ef
Add TODO.
khatchad Dec 9, 2025
5533651
Remove block.
khatchad Dec 11, 2025
5302618
Add log.
khatchad Dec 11, 2025
4f9cb95
Fix handling of ragged dimensions when inner lists multiple possible …
khatchad Dec 11, 2025
174ebf7
Allocate more space when creating `newShape` list to avoid resizing.
khatchad Dec 11, 2025
bea52a4
Progress on inner shapes.
khatchad Dec 11, 2025
cb0d921
TODO.
khatchad Dec 11, 2025
6f53b16
Update tests to use more accurate tensor types.
khatchad Dec 11, 2025
6901063
Suppress failures due to https://github.com/wala/ML/issues/340.
khatchad Dec 15, 2025
4951e69
Add `this` keyword to method call in Constant.java.
khatchad Dec 15, 2025
a2ba663
Fix `getSignature` in `RaggedConstant` to return the correct function…
khatchad Dec 15, 2025
a48bc7d
Handle the multiplication of tensors with broadcasting in TensorFlow.
khatchad Dec 15, 2025
e494084
Suppress test failure for https://github.com/wala/ML/issues/340.
khatchad Dec 18, 2025
9a54455
Merge branch '267-initial-tensor-dimensions-arent-always-accurate' of…
khatchad Dec 19, 2025
aed7147
Add assertions.
khatchad Dec 19, 2025
c4d2be2
Merge branch '267-initial-tensor-dimensions-arent-always-accurate' of…
khatchad Dec 19, 2025
3715148
Generalize `Multiply` to `ElementWiseOperation` to cover add, subtrac…
khatchad Dec 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion com.ibm.wala.cast.python.jython.test/.classpath
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-25">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ org.eclipse.jdt.core.classpath.mainOnlyProjectHasTestOnlyDependency=error
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
org.eclipse.jdt.core.classpath.outputOverlappingAnotherSource=error
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=21
org.eclipse.jdt.core.compiler.compliance=21
org.eclipse.jdt.core.compiler.codegen.targetPlatform=25
org.eclipse.jdt.core.compiler.compliance=25
org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=21
org.eclipse.jdt.core.compiler.source=25
org.eclipse.jdt.core.incompatibleJDKLevel=ignore
org.eclipse.jdt.core.incompleteClasspath=error
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package com.ibm.wala.cast.python.ml.test;

import static com.ibm.wala.cast.python.ml.types.TensorFlowTypes.DType.FLOAT32;
import static com.ibm.wala.cast.python.ml.types.TensorFlowTypes.DType.FLOAT64;
import static com.ibm.wala.cast.python.ml.types.TensorFlowTypes.DType.INT32;
import static com.ibm.wala.cast.python.ml.types.TensorFlowTypes.DType.INT64;
import static com.ibm.wala.cast.python.ml.types.TensorFlowTypes.DType.STRING;
import static org.junit.Assert.*;

import com.ibm.wala.cast.python.ml.types.TensorFlowTypes.DType;
import org.junit.Test;

public class TensorFlowTypesTest {

@Test
public void testCanConvertTo() {
assertTrue(FLOAT32.canConvertTo(FLOAT32));
assertTrue(FLOAT32.canConvertTo(FLOAT64));
assertFalse(FLOAT64.canConvertTo(FLOAT32));
assertFalse(FLOAT64.canConvertTo(DType.STRING));
assertFalse(STRING.canConvertTo(FLOAT32));
assertTrue(STRING.canConvertTo(DType.STRING));
assertTrue(INT32.canConvertTo(DType.INT32));
assertTrue(INT32.canConvertTo(DType.FLOAT32));
assertFalse(INT32.canConvertTo(DType.STRING));
assertFalse(STRING.canConvertTo(DType.INT32));
assertTrue(INT64.canConvertTo(DType.FLOAT64));
assertFalse(INT64.canConvertTo(DType.FLOAT32));
assertFalse(INT64.canConvertTo(DType.INT32));
assertTrue(INT32.canConvertTo(DType.INT64));
assertTrue(FLOAT64.canConvertTo(DType.FLOAT64));
assertFalse(FLOAT32.canConvertTo(DType.INT32));
assertTrue(FLOAT32.canConvertTo(DType.FLOAT32));
assertFalse(FLOAT64.canConvertTo(DType.INT64));
assertFalse(FLOAT64.canConvertTo(DType.INT32));
}
}
Loading
Loading