1616import json
1717import logging
1818import os
19+ from typing import Dict
1920import uuid
2021from abc import ABCMeta , abstractmethod
2122
@@ -582,7 +583,7 @@ def _get_or_create_name(self, name=None):
582583 return name_from_base (self .base_job_name )
583584
584585 @staticmethod
585- def _json_encode_hyperparameters (hyperparameters ) :
586+ def _json_encode_hyperparameters (hyperparameters : dict ) -> dict :
586587 """Applies Json encoding for certain Hyperparameter types, returns hyperparameters.
587588
588589 Args:
@@ -661,14 +662,14 @@ def _prepare_for_training(self, job_name=None):
661662 self ._prepare_debugger_for_training ()
662663 self ._prepare_profiler_for_training ()
663664
664- def _script_mode_hyperparam_update (self , code_dir , script ) :
665+ def _script_mode_hyperparam_update (self , code_dir : str , script : str ) -> None :
665666 """Applies in-place update to hyperparameters required for script mode with training.
666667
667668 Args:
668669 code_dir (str): The directory hosting the training scripts.
669670 script (str): The relative filepath of the training entry-point script.
670671 """
671- hyperparams = {}
672+ hyperparams : Dict [ str , str ] = {}
672673 hyperparams [DIR_PARAM_NAME ] = code_dir
673674 hyperparams [SCRIPT_PARAM_NAME ] = script
674675 hyperparams [CONTAINER_LOG_LEVEL_PARAM_NAME ] = self .container_log_level
@@ -677,7 +678,7 @@ def _script_mode_hyperparam_update(self, code_dir, script):
677678
678679 self ._hyperparameters .update (EstimatorBase ._json_encode_hyperparameters (hyperparams ))
679680
680- def _stage_user_code_in_s3 (self ):
681+ def _stage_user_code_in_s3 (self ) -> str :
681682 """Upload the user training script to s3 and return the location.
682683
683684 Returns: s3 uri
@@ -2615,14 +2616,14 @@ def _prepare_for_training(self, job_name=None):
26152616
26162617 self ._validate_and_set_debugger_configs ()
26172618
2618- def _script_mode_hyperparam_update (self , code_dir , script ) :
2619+ def _script_mode_hyperparam_update (self , code_dir : str , script : str ) -> None :
26192620 """Applies in-place update to hyperparameters required for script mode with training.
26202621
26212622 Args:
26222623 code_dir (str): The directory hosting the training scripts.
26232624 script (str): The relative filepath of the training entry-point script.
26242625 """
2625- hyperparams = {}
2626+ hyperparams : Dict [ str , str ] = {}
26262627 hyperparams [DIR_PARAM_NAME ] = code_dir
26272628 hyperparams [SCRIPT_PARAM_NAME ] = script
26282629 hyperparams [CONTAINER_LOG_LEVEL_PARAM_NAME ] = self .container_log_level
0 commit comments