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
Update base for Update on "[ET-VK] Add pass to remove local_scalar_dense"
## Context
Scalar tensors (i.e. tensors with only 1 element) are often passed in to functions as scalars via
```
scalar_tensor[0].item()
```
This translates to the following chain in the graph
```
index_select = index_select(scalar_tensor, ...)
scalar = local_scalar_dense(index_select)
```
This diff introduces a pass to remove the `local_scalar_dense` "chain" in favor of passing in the input tensor directly.
Note that this replacement only occurs if the original tensor is a scalar tensor.
In the Vulkan backend, these scalar tensors will be represented as symbolic integers instead of actual tensors, which is why this replacement is valid. However, it may not a valid replacement for other backends.
Differential Revision: [D63913432](https://our.internmc.facebook.com/intern/diff/D63913432/)
[ghstack-poisoned]
0 commit comments