def _check_for_torch_xla()

in src/sagemaker_training/pytorch_xla.py [0:0]


    def _check_for_torch_xla(self):
        # pylint: disable=no-self-use
        try:
            import torch_xla  # pylint: disable=unused-import # noqa: F401
        except ModuleNotFoundError as exception:
            raise errors.SMTrainingCompilerConfigurationError(
                "Unable to find PT-XLA in the execution environment. "
                "This distribution mechanism requires PT-XLA to be available"
                " in the execution environment. "
                "SageMaker Training Compiler provides ready-to-use containers with PT-XLA. "
                "Please refer to https://github.com/aws/deep-learning-containers"
                "/blob/master/available_images.md "
            ) from exception