You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix unnecessary calls to compute shape of trace tensor; fix#246 (#280)
This MR resolves the following:
1. In a trivial example like below, we were earlier computing shape of
dynamic shape trace tensor which can become very expensive if reshape
occurs somewhere in the middle of a big compute graph. The fix is a
simple hack to force the shape of trace tensor when its statically known
(in this case it is when we convert a shape scalar to 1d tensor).
```py
a = tp.ones((2, 3, 4))
s1, s2, s3 = a.shape
out = tp.reshape(a, (s1, s2, s3 / 2, 2))
```
2. Fixes#246 (thanks to @yizhuoz004 for the suggested fix)
0 commit comments