Skip to content
Open
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
2 changes: 1 addition & 1 deletion onnxscript/function_libs/torch_lib/ops/nn.py
Original file line number Diff line number Diff line change
Expand Up @@ -2077,7 +2077,7 @@
key_transposed_scaled = op.Mul(key_transposed, op.Sqrt(scale))
# Turn the Boolean mask to float: attn_mask.masked_fill(not attn_mask, -float('inf'))
zero = op.Constant(value=ir.tensor(0.0, dtype=query.dtype))
neg_inf = op.Constant(value=ir.tensor(-float("inf"), dtype=query.dtype))
neg_inf = op.Constant(value=ir.tensor(query.dtype.min), dtype=query.dtype)

Check failure

Code scanning / lintrunner

PYLINT/E1123 Error

Unexpected keyword argument 'dtype' in method call (unexpected-keyword-arg)
See unexpected-keyword-arg. To disable, use # pylint: disable=unexpected-keyword-arg
attn_mask = op.Where(attn_mask, zero, neg_inf)
attn_weight = op.Softmax(
op.Add(op.MatMul(query_scaled, key_transposed_scaled), attn_mask),
Expand Down
Loading