backend package

Submodules

backend.dp_backend module

backend.dynamic_metadata module

backend.dynamic_metadata.dynamic_metadata(field: str, settings: Optional[Dict[str, object]] = None)[source]

backend.find_tensorflow module

backend.find_tensorflow.find_tensorflow() Tuple[Optional[str], List[str]][source]

Find TensorFlow library.

Tries to find TensorFlow in the order of:

  1. Environment variable TENSORFLOW_ROOT if set

  2. The current Python environment.

  3. user site packages directory if enabled

  4. system site packages directory (purelib)

  5. add as a requirement (detect TENSORFLOW_VERSION or the latest) and let pip install it

Returns
str

TensorFlow library path if found.

list of str

TensorFlow requirement if not found. Empty if found.

backend.find_tensorflow.get_tf_requirement(tf_version: str = '') dict[source]

Get TensorFlow requirement (CPU) when TF is not installed.

If tf_version is not given and the environment variable TENSORFLOW_VERSION is set, use it as the requirement.

Parameters
tf_versionstr, optional

TF version

Returns
dict

TensorFlow requirement, including cpu and gpu.

backend.find_tensorflow.get_tf_version(tf_path: Union[str, Path]) str[source]

Get TF version from a TF Python library path.

Parameters
tf_pathstr or Path

TF Python library path

Returns
str

version

backend.read_env module

Read environment variables to configure the build.

backend.read_env.get_argument_from_env() Tuple[str, list, list, dict, str][source]

Get the arguments from environment variables.

The environment variables are assumed to be not changed during the build.

Returns
str

The minimum required CMake version.

list of str

The CMake arguments.

list of str

The requirements for the build.

dict

The extra scripts to be installed.

str

The TensorFlow version.

backend.read_env.set_scikit_build_env()[source]

Set scikit-build environment variables before executing scikit-build.