Skip to content

Commit

Permalink
Only check spox installed as depends on onnx
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancescMartiEscofetQC committed Jul 24, 2024
1 parent a025e78 commit de5d495
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 9 deletions.
1 change: 0 additions & 1 deletion metalearners/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,6 @@ def infer_probabilities_output(model) -> tuple[int, str]:
def infer_input_dict(model) -> dict:
"""Returns a dict where the keys are the input names of the model and the values are
``spox.Var`` with the corresponding shape and type."""
check_onnx_installed()
check_spox_installed()
from spox import Tensor, Var, argument

Expand Down
2 changes: 0 additions & 2 deletions metalearners/drlearner.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
_ScikitModel,
)
from metalearners._utils import (
check_onnx_installed,
check_spox_installed,
clip_element_absolute_value_to_epsilon,
copydoc,
Expand Down Expand Up @@ -417,7 +416,6 @@ def build_onnx(self, models: Mapping[str, Sequence], output_name: str = "tau"):
* ``"treatment_model"``
"""
warning_experimental_feature("build_onnx")
check_onnx_installed()
check_spox_installed()
import spox.opset.ai.onnx.v21 as op
from onnx.checker import check_model
Expand Down
2 changes: 0 additions & 2 deletions metalearners/rlearner.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

from metalearners._typing import Matrix, OosMethod, Scoring, Vector
from metalearners._utils import (
check_onnx_installed,
check_spox_installed,
clip_element_absolute_value_to_epsilon,
copydoc,
Expand Down Expand Up @@ -537,7 +536,6 @@ def build_onnx(self, models: Mapping[str, Sequence], output_name: str = "tau"):
* ``"treatment_model"``
"""
warning_experimental_feature("build_onnx")
check_onnx_installed()
check_spox_installed()
import spox.opset.ai.onnx.v21 as op
from onnx.checker import check_model
Expand Down
2 changes: 0 additions & 2 deletions metalearners/tlearner.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

from metalearners._typing import Matrix, OosMethod, Scoring, Vector
from metalearners._utils import (
check_onnx_installed,
check_spox_installed,
copydoc,
index_matrix,
Expand Down Expand Up @@ -162,7 +161,6 @@ def build_onnx(self, models: Mapping[str, Sequence], output_name: str = "tau"):
* ``"variant_outcome_model"``
"""
warning_experimental_feature("build_onnx")
check_onnx_installed()
check_spox_installed()
import spox.opset.ai.onnx.v21 as op
from onnx.checker import check_model
Expand Down
2 changes: 0 additions & 2 deletions metalearners/xlearner.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

from metalearners._typing import Matrix, OosMethod, Scoring, Vector
from metalearners._utils import (
check_onnx_installed,
check_spox_installed,
copydoc,
get_one,
Expand Down Expand Up @@ -452,7 +451,6 @@ def build_onnx(self, models: Mapping[str, Sequence], output_name: str = "tau"):
* ``"treatment_effect_model"``
"""
warning_experimental_feature("build_onnx")
check_onnx_installed()
check_spox_installed()
import spox.opset.ai.onnx.v21 as op
from onnx.checker import check_model
Expand Down

0 comments on commit de5d495

Please sign in to comment.