Skip to content

Commit 237b61d

Browse files
Balandatfacebook-github-bot
authored andcommitted
Migrate typing_extensions.Self to typing.Self (#3181)
Summary: Python 3.11 added `Self` to the standard `typing` module, so we no longer need to import it from `typing_extensions`. Files updated: - botorch/models/model.py - botorch/models/approximate_gp.py Reviewed By: hvarfner Differential Revision: D91641970
1 parent 1855320 commit 237b61d

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

botorch/models/approximate_gp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
import copy
3333
import warnings
34+
from typing import Self
3435

3536
import torch
3637
from botorch.acquisition.objective import PosteriorTransform
@@ -67,7 +68,6 @@
6768
)
6869
from torch import Tensor
6970
from torch.nn import Module
70-
from typing_extensions import Self
7171

7272

7373
TRANSFORM_WARNING = (

botorch/models/model.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from abc import ABC, abstractmethod
1717
from collections import defaultdict
1818
from collections.abc import Callable, Mapping
19-
from typing import Any, TYPE_CHECKING
19+
from typing import Any, Self, TYPE_CHECKING
2020

2121
import numpy as np
2222
import torch
@@ -36,7 +36,6 @@
3636
from gpytorch.likelihoods.gaussian_likelihood import FixedNoiseGaussianLikelihood
3737
from torch import Tensor
3838
from torch.nn import Module, ModuleDict, ModuleList
39-
from typing_extensions import Self
4039

4140
if TYPE_CHECKING:
4241
from botorch.acquisition.objective import PosteriorTransform # pragma: no cover

0 commit comments

Comments
 (0)