Skip to content

Commit 0871a19

Browse files
manuelcandalesfacebook-github-bot
authored andcommitted
SpecDB: Add spec: trunc
Reviewed By: SS-JIA Differential Revision: D52924184 fbshipit-source-id: 98f0cf9e4b8a6f02649d0160af498d5e3bec6634
1 parent 4248469 commit 0871a19

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

specdb/db.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3070,6 +3070,26 @@
30703070
OutArg(ArgType.Tensor),
30713071
],
30723072
),
3073+
Spec(
3074+
op="trunc.default", # (Tensor self) -> Tensor
3075+
inspec=[
3076+
InPosArg(
3077+
ArgType.Tensor,
3078+
name="self",
3079+
constraints=[
3080+
cp.Dtype.Ne(lambda deps: torch.bool),
3081+
],
3082+
),
3083+
],
3084+
outspec=[
3085+
OutArg(
3086+
ArgType.Tensor,
3087+
constraints=[
3088+
cp.Dtype.Eq(lambda deps: deps[0].dtype),
3089+
],
3090+
)
3091+
],
3092+
),
30733093
Spec(
30743094
op="unbind_copy.int", # (Tensor self, int dim=0) -> Tensor[]
30753095
inspec=[

0 commit comments

Comments
 (0)