1010# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
1111# ANY KIND, either express or implied. See the License for the specific
1212# language governing permissions and limitations under the License.
13- """Utility methods used by framework classes"""
13+ """Utility methods used by framework classes. """
1414from __future__ import absolute_import
1515
1616import json
4040
4141UploadedCode = namedtuple ("UploadedCode" , ["s3_prefix" , "script_name" ])
4242"""sagemaker.fw_utils.UploadedCode: An object containing the S3 prefix and script name.
43+
4344This is for the source code used for the entry point with an ``Estimator``. It can be
4445instantiated with positional or keyword arguments.
4546"""
@@ -210,7 +211,7 @@ def validate_source_code_input_against_pipeline_variables(
210211 git_config : Optional [Dict [str , str ]] = None ,
211212 enable_network_isolation : Union [bool , PipelineVariable ] = False ,
212213):
213- """Validate source code input against pipeline variables
214+ """Validate source code input against pipeline variables.
214215
215216 Args:
216217 entry_point (str or PipelineVariable): The path to the local Python source file that
@@ -480,7 +481,7 @@ def tar_and_upload_dir(
480481
481482
482483def _list_files_to_compress (script , directory ):
483- """Placeholder docstring"""
484+ """Placeholder docstring. """
484485 if directory is None :
485486 return [script ]
486487
@@ -619,8 +620,6 @@ def warn_if_parameter_server_with_multi_gpu(training_instance_type, distribution
619620 "enabled": True
620621 }
621622 }
622-
623-
624623 """
625624 if training_instance_type == "local" or distribution is None :
626625 return
@@ -645,7 +644,8 @@ def warn_if_parameter_server_with_multi_gpu(training_instance_type, distribution
645644def profiler_config_deprecation_warning (
646645 profiler_config , image_uri , framework_name , framework_version
647646):
648- """Put out a deprecation message for if framework profiling is specified TF >= 2.12 and PT >= 2.0"""
647+ """Put out a deprecation message for if framework profiling is specified TF >= 2.12 and PT >=
648+ 2.0."""
649649 if profiler_config is None or profiler_config .framework_profile_params is None :
650650 return
651651
@@ -952,7 +952,7 @@ def validate_distribution(
952952
953953
954954def validate_distribution_for_instance_type (instance_type , distribution ):
955- """Check if the provided distribution strategy is supported for the instance_type
955+ """Check if the provided distribution strategy is supported for the instance_type.
956956
957957 Args:
958958 instance_type (str): A string representing the type of training instance selected.
@@ -1071,7 +1071,7 @@ def validate_torch_distributed_distribution(
10711071
10721072
10731073def _is_gpu_instance (instance_type ):
1074- """Returns bool indicating whether instance_type supports GPU
1074+ """Returns bool indicating whether instance_type supports GPU.
10751075
10761076 Args:
10771077 instance_type (str): Name of the instance_type to check against.
@@ -1090,7 +1090,7 @@ def _is_gpu_instance(instance_type):
10901090
10911091
10921092def _is_trainium_instance (instance_type ):
1093- """Returns bool indicating whether instance_type is a Trainium instance
1093+ """Returns bool indicating whether instance_type is a Trainium instance.
10941094
10951095 Args:
10961096 instance_type (str): Name of the instance_type to check against.
@@ -1106,7 +1106,7 @@ def _is_trainium_instance(instance_type):
11061106
11071107
11081108def python_deprecation_warning (framework , latest_supported_version ):
1109- """Placeholder docstring"""
1109+ """Placeholder docstring. """
11101110 return PYTHON_2_DEPRECATION_WARNING .format (
11111111 framework = framework , latest_supported_version = latest_supported_version
11121112 )
@@ -1120,7 +1120,6 @@ def _region_supports_debugger(region_name):
11201120
11211121 Returns:
11221122 bool: Whether or not the region supports Amazon SageMaker Debugger.
1123-
11241123 """
11251124 return region_name .lower () not in DEBUGGER_UNSUPPORTED_REGIONS
11261125
@@ -1133,7 +1132,6 @@ def _region_supports_profiler(region_name):
11331132
11341133 Returns:
11351134 bool: Whether or not the region supports Amazon SageMaker Debugger profiling feature.
1136-
11371135 """
11381136 return region_name .lower () not in PROFILER_UNSUPPORTED_REGIONS
11391137
0 commit comments