def _create_command()

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


    def _create_command(self):
        entrypoint_type = _entry_point_type.get(environment.code_dir, self._user_entry_point)

        if entrypoint_type is _entry_point_type.PYTHON_PACKAGE:
            raise errors.SMTrainingCompilerConfigurationError(
                "Distributed Training through PT-XLA is not supported for Python packages. "
                "Please use a python script as the entry-point"
            )
        if entrypoint_type is _entry_point_type.PYTHON_PROGRAM:
            return self._pytorch_xla_command() + [self._user_entry_point] + self._args
        else:
            raise errors.SMTrainingCompilerConfigurationError(
                "Distributed Training through PT-XLA is only supported for Python scripts. "
                "Please use a python script as the entry-point"
            )