Files
torus-ml/docs/references/api/torus.ml.common.check_inputs.md
zeekay e037e8f7ea torus: one name for the package, and it is ours
The distribution called itself torus-ml while shipping a package directory
named concrete, so the name a user installs and the name they import disagreed
— and most of the tree already said torus.ml, which could not resolve against
src/concrete. Moved src/concrete to src/torus and pointed the include at it.

The dependency was Zama's concrete-python from their index. It is torus-fhe
from ours, which is what luxfhe/torus already ships: that frontend declares
torus-fhe and ships a torus/fhe module, so every 'from torus.fhe' in this tree
was already naming our compiler and only the dependency lagged.

Two distributions share one namespace, which is the shape the upstream this
forked from used and the reason the split works: torus-fhe gives torus.fhe,
torus-ml gives torus.ml.

Swept every other spelling — identifiers, enum members, workflow variables,
filenames, notebooks. LICENSE and NOTICE keep the upstream attribution a fork
owes; the figures carry the old name in JPEG metadata a text sweep cannot
reach.
2026-08-27 13:20:50 -07:00

2.8 KiB

module torus.ml.common.check_inputs

Check and conversion tools.

Utils that are used to check (including convert) some data types which are compatible with scikit-learn to numpy types.


function check_array_and_assert

check_array_and_assert(X, *args, **kwargs)

sklearn.utils.check_array with an assert.

Equivalent of sklearn.utils.check_array, with a final assert that the type is one which is supported by Torus ML.

Args:

  • X (object): Input object to check / convert
  • *args: The arguments to pass to check_array
  • **kwargs: The keyword arguments to pass to check_array

Returns: The converted and validated array


function check_X_y_and_assert

check_X_y_and_assert(X, y, *args, **kwargs)

sklearn.utils.check_X_y with an assert.

Equivalent of sklearn.utils.check_X_y, with a final assert that the type is one which is supported by Torus ML.

Args:

  • X (ndarray, list, sparse matrix): Input data
  • y (ndarray, list, sparse matrix): Labels
  • *args: The arguments to pass to check_X_y
  • **kwargs: The keyword arguments to pass to check_X_y

Returns: The converted and validated arrays


function check_X_y_and_assert_multi_output

check_X_y_and_assert_multi_output(X, y, *args, **kwargs)

sklearn.utils.check_X_y with an assert and multi-output handling.

Equivalent of sklearn.utils.check_X_y, with a final assert that the type is one which is supported by Torus ML. If y is 2D, allows multi-output.

Args:

  • X (ndarray, list, sparse matrix): Input data
  • y (ndarray, list, sparse matrix): Labels
  • *args: The arguments to pass to check_X_y
  • **kwargs: The keyword arguments to pass to check_X_y

Returns: The converted and validated arrays with multi-output targets.