Skip to content

Commit b9133d4

Browse files
j-t-1facebook-github-bot
authored andcommitted
Tweak comments (meta-pytorch#1565)
Summary: Also use integer for numerator in division. Pull Request resolved: meta-pytorch#1565 Reviewed By: cyrjano Differential Revision: D74943172 Pulled By: jjuncho fbshipit-source-id: 251b8ce1cc849de9aa39eb1c99910fc660064885
1 parent 4e8aee1 commit b9133d4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

captum/module/binary_concrete_stochastic_gates.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def __init__(
5858
n_gates: int,
5959
mask: Optional[Tensor] = None,
6060
reg_weight: float = 1.0,
61-
temperature: float = 2.0 / 3,
61+
temperature: float = 2 / 3,
6262
lower_bound: float = -0.1,
6363
upper_bound: float = 1.1,
6464
eps: float = 1e-8,
@@ -118,16 +118,17 @@ def __init__(
118118

119119
assert (
120120
0 < temperature < 1
121-
), f"the temperature should be bwteen 0 and 1, received {temperature}"
121+
), f"the temperature should be between 0 and 1, received {temperature}"
122122
self.temperature = temperature
123123

124124
assert (
125125
lower_bound < 0
126-
), f"the stretch lower bound should smaller than 0, received {lower_bound}"
126+
), f"the stretch lower bound should be smaller than 0, received {lower_bound}"
127127
self.lower_bound = lower_bound
128+
128129
assert (
129130
upper_bound > 1
130-
), f"the stretch upper bound should larger than 1, received {upper_bound}"
131+
), f"the stretch upper bound should be larger than 1, received {upper_bound}"
131132
self.upper_bound = upper_bound
132133

133134
self.eps = eps

0 commit comments

Comments
 (0)