Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions facto/specdb/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -2582,6 +2582,30 @@
],
outspec=[OutArg(ArgType.Tensor)],
),
Spec(
op="hardshrink.default", # (Tensor self, Scalar lambd=0.5) -> Tensor
inspec=[
InPosArg(
ArgType.Tensor,
name="self",
constraints=[
cp.Dtype.In(lambda deps: dt._floating),
],
),
InPosArg(
ArgType.Scalar,
name="lambd",
constraints=[
cp.Value.Ge(lambda deps, dtype: 0),
# Upper bound to prevent overflow when converting to float16
#
# Default value for lambd in this operator is 0.5
cp.Value.Le(lambda deps, dtype: 100),
],
),
],
outspec=[OutArg(ArgType.Tensor)],
),
Spec(
op="hardtanh.default", # (Tensor self, Scalar min_val=-1, Scalar max_val=1) -> Tensor
inspec=[
Expand Down
Loading