Skip to content

Commit 0e43eef

Browse files
committed
use is instead of isinstance
1 parent 4e0f3c1 commit 0e43eef

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

gpytorch/constraints/constraints.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def __init__(self, lower_bound, upper_bound, transform=sigmoid, inv_transform=in
3232
if torch.any(torch.ge(lower_bound, upper_bound)):
3333
raise ValueError("Got parameter bounds with empty intervals.")
3434

35-
if isinstance(self, Interval):
35+
if type(self) is Interval:
3636
max_bound = torch.max(upper_bound)
3737
min_bound = torch.min(lower_bound)
3838
if max_bound == math.inf or min_bound == -math.inf:

gpytorch/test/base_test_case.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def assertEqual(self, item1, item2):
5858
raise AssertionError(f"item1 ({type(item1)}) and item2 ({type(item2)}) are not the same type.")
5959
elif item1 == item2:
6060
return True
61-
elif isinstance(item1, type(item2)):
61+
elif type(item1) is type(item2):
6262
raise AssertionError(f"item1 ({type(item1)}) and item2 ({type(item2)}) are not the same type.")
6363
else:
6464
raise AssertionError(f"tensor1 ({item1}) does not equal tensor2 ({item2}).")

0 commit comments

Comments
 (0)