Skip to content

Commit

Permalink
RF Parameter fix for bool dtype
Browse files Browse the repository at this point in the history
  • Loading branch information
albertz committed Nov 17, 2023
1 parent 55ede50 commit a9a6690
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion returnn/torch/frontend/_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ def create_parameter_raw(tensor: rf.Parameter, *, device: Optional[str] = None)
dtype=TorchBackend.as_dtype_raw(tensor.dtype),
device=device or rf.get_default_device(),
)
if tensor.dtype.startswith("int"):
if tensor.dtype.startswith("int") or tensor.dtype == "bool":
requires_grad = False
else:
requires_grad = True
Expand Down

0 comments on commit a9a6690

Please sign in to comment.