Skip to content

Commit a5faf03

Browse files
jorgep31415facebook-github-bot
authored andcommitted
Include alpha to fix aten.sub.Tensor (#2418)
Summary: Pull Request resolved: #2418 Missed this in #2366 ghstack-source-id: 218593311 exported-using-ghexport bypass-github-export-checks Reviewed By: SS-JIA Differential Revision: D54880024 fbshipit-source-id: c4e19d8fefbb9d2fc4547ec2edc236060638da5e
1 parent caee336 commit a5faf03

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

backends/vulkan/runtime/graph/ops/glsl/all_shaders.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ binary_op:
1919
shader_variants:
2020
- NAME: binary_add
2121
- NAME: binary_sub
22-
OPERATOR: X - Y
22+
OPERATOR: X - A * Y
2323
- NAME: binary_mul
2424
OPERATOR: X * Y
2525
- NAME: binary_div

backends/vulkan/test/test_vulkan_delegate.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ def __init__(self):
124124
self.weight = torch.rand(size=(2, 3), dtype=torch.float32)
125125

126126
def forward(self, x, y):
127-
z = x + y
128-
z = z + x
127+
z = torch.add(x, y, alpha=2)
128+
z = torch.add(x, y, alpha=3.14)
129129
z = z + x
130130
z = z + self.weight
131131
return z
@@ -144,8 +144,8 @@ def __init__(self):
144144
super().__init__()
145145

146146
def forward(self, x, y):
147-
z = x - y
148-
z = z - x
147+
z = torch.sub(x, y, alpha=2)
148+
z = torch.sub(z, x, alpha=3.14)
149149
z = z - x
150150
return z
151151

0 commit comments

Comments
 (0)