Skip to content

Commit 2d1cba5

Browse files
manuelcandalesfacebook-github-bot
authored andcommitted
SpecDB: Add spec: atan2
Reviewed By: SS-JIA Differential Revision: D52924183 fbshipit-source-id: 5a101f0b21b75ecb3ab1bdda7dc8582c11b801c6
1 parent 0871a19 commit 2d1cba5

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

specdb/db.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,35 @@
582582
OutArg(ArgType.Tensor),
583583
],
584584
),
585+
Spec(
586+
op="atan2.default", # (Tensor self, Tensor other) -> Tensor
587+
inspec=[
588+
InPosArg(ArgType.Tensor, name="self"),
589+
InPosArg(
590+
ArgType.Tensor,
591+
name="other",
592+
deps=[0],
593+
constraints=[
594+
cp.Size.In(
595+
lambda deps, r, d: fn.broadcast_with(deps[0].shape, r, d)
596+
),
597+
],
598+
),
599+
],
600+
outspec=[
601+
OutArg(
602+
ArgType.Tensor,
603+
constraints=[
604+
cp.Dtype.In(lambda deps: dt.can_cast_from(torch.float)),
605+
cp.Dtype.In(
606+
lambda deps: dt.can_cast_from(
607+
torch.promote_types(deps[0].dtype, deps[1].dtype)
608+
)
609+
),
610+
],
611+
)
612+
],
613+
),
585614
Spec(
586615
op="atanh.default", # (Tensor self) -> Tensor
587616
inspec=[

0 commit comments

Comments
 (0)