class_docstr: Handle end-to-end training and deployment of custom PyTorch code.
class_docstr_tok: ["Handle","end-to-end","training","and","deployment","of","custom","PyTorch","code","."]
docstr: Convert the job description to init params that can be handled by the class constructor.
  
  Args:
      job_details: the returned job details from a describe_training_job
          API call.
      model_channel_name (str): Name of the channel where pre-trained
          model data will be downloaded.
  
  Returns:
      dictionary: The transformed init_params
docstr_tok: ["Convert","the","job","description","to","init","params","that","can","be","handled","by","the","class","constructor",".","Args",":","job_details",":","the","returned","job","details","from","a","describe_training_job","API","call",".","model_channel_name","(","str",")",":","Name","of","the","channel","where","pre-trained","model","data","will","be","downloaded",".","Returns",":","dictionary",":","The","transformed","init_params"]
code: def _prepare_init_params_from_job_description(
      cls, job_details, model_channel_name=None
  ):
      """Convert the job description to init params that can be handled by the class constructor.
  
      Args:
          job_details: the returned job details from a describe_training_job
              API call.
          model_channel_name (str): Name of the channel where pre-trained
              model data will be downloaded.
  
      Returns:
          dictionary: The transformed init_params
      """
      init_params = super(
          PyTorch, cls
      )._prepare_init_params_from_job_description(
          job_details, model_channel_name
      )
      image_uri = init_params.pop("image_uri")
      framework, py_version, tag, _ = framework_name_from_image(
          image_uri
      )
      if framework:
          framework = framework.split("-")[0]
  
      if tag is None:
          framework_version = None
      else:
          framework_version = framework_version_from_tag(tag)
      init_params["framework_version"] = framework_version
      init_params["py_version"] = py_version
  
      if not framework:
          # If we were unable to parse the framework name from the image it is not one of our
          # officially supported images, in this case just add the image to the init params.
          init_params["image_uri"] = image_uri
          return init_params
  
      if framework != cls._framework_name:
          raise ValueError(
              "Training job: {} didn't use image for requested framework".format(
                  job_details["TrainingJobName"]
              )
          )
  
      return init_params
  
file_path: sagemaker-python-sdk/src/sagemaker/pytorch/estimator.py
imports: from __future__ import absolute_import
  import logging
  from typing import Union, Optional, Dict
  from packaging.version import Version
  from sagemaker.estimator import Framework, EstimatorBase
  from sagemaker.fw_utils import framework_name_from_image, framework_version_from_tag, python_deprecation_warning, validate_version_or_image_args, validate_distribution, profiler_config_deprecation_warning
  from sagemaker.pytorch import defaults
  from sagemaker.pytorch.model import PyTorchModel
  from sagemaker.pytorch.training_compiler.config import TrainingCompilerConfig
  from sagemaker.vpc_utils import VPC_CONFIG_DEFAULT
  from sagemaker.workflow.entities import PipelineVariable
label_desc: Use image node_id 5 for calling the PyTorch obj's underlying member method code with example usage: obj._prepare_init_params_from_job_description(cls, job_details, model_channel_name) and returns: init_params, init_params