Skip to content

Commit e34b6a0

Browse files
angelayipytorchmergebot
authored andcommitted
Add meta for add.Scalar (pytorch#161332)
Fixes pytorch#161076 Pull Request resolved: pytorch#161332 Approved by: https://github.com/Skylion007
1 parent f795e92 commit e34b6a0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

torch/_meta_registrations.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4193,6 +4193,18 @@ def is_booleanic(arg):
41934193
return self
41944194

41954195

4196+
@register_meta(
4197+
[
4198+
aten.add.Scalar,
4199+
aten.sub.Scalar,
4200+
],
4201+
)
4202+
def meta_binop_alpha(self, other, alpha=1):
4203+
return elementwise_meta(
4204+
self, other, type_promotion=ELEMENTWISE_TYPE_PROMOTION_KIND.DEFAULT
4205+
)
4206+
4207+
41964208
@register_meta([aten.round.default, aten.round.decimals])
41974209
def meta_round(self, **kwargs):
41984210
return elementwise_meta(

0 commit comments

Comments
 (0)