|
11 | 11 | from linear_operator.operators.dense_linear_operator import DenseLinearOperator, to_linear_operator |
12 | 12 |
|
13 | 13 | from linear_operator.utils.broadcasting import _matmul_broadcast_shape |
14 | | -from linear_operator.utils.deprecation import bool_compat |
15 | 14 | from linear_operator.utils.generic import _to_helper |
16 | 15 | from linear_operator.utils.getitem import _noop_index |
17 | 16 |
|
@@ -188,7 +187,7 @@ def _get_indices(self, row_index: IndexType, col_index: IndexType, *batch_indice |
188 | 187 |
|
189 | 188 | # Find out for which indices we switch to different tensors |
190 | 189 | target_tensors = self.idx_to_tensor_idx[cat_dim_indices] |
191 | | - does_switch_tensor = torch.ones(target_tensors.numel() + 1, dtype=bool_compat, device=self.device) |
| 190 | + does_switch_tensor = torch.ones(target_tensors.numel() + 1, dtype=torch.bool, device=self.device) |
192 | 191 | torch.ne(target_tensors[:-1], target_tensors[1:], out=does_switch_tensor[1:-1]) |
193 | 192 |
|
194 | 193 | # Get the LinearOperators that will comprise the new LinearOperator |
@@ -258,7 +257,7 @@ def _getitem(self, row_index: IndexType, col_index: IndexType, *batch_indices: I |
258 | 257 |
|
259 | 258 | # Find out for which indices we switch to different tensors |
260 | 259 | target_tensors = self.idx_to_tensor_idx[cat_dim_indices] |
261 | | - does_switch_tensor = torch.ones(target_tensors.numel() + 1, dtype=bool_compat, device=self.device) |
| 260 | + does_switch_tensor = torch.ones(target_tensors.numel() + 1, dtype=torch.bool, device=self.device) |
262 | 261 | torch.ne(target_tensors[:-1], target_tensors[1:], out=does_switch_tensor[1:-1]) |
263 | 262 |
|
264 | 263 | # Get the LinearOperators that will comprise the new LinearOperator |
@@ -294,7 +293,7 @@ def _getitem(self, row_index: IndexType, col_index: IndexType, *batch_indices: I |
294 | 293 |
|
295 | 294 | else: |
296 | 295 | raise RuntimeError( |
297 | | - "Unexpected index type {cat_dim_indices.__class__.__name__}. This is a bug in LinearOperator." |
| 296 | + f"Unexpected index type {cat_dim_indices.__class__.__name__}. This is a bug in LinearOperator." |
298 | 297 | ) |
299 | 298 |
|
300 | 299 | # Process the list |
|
0 commit comments