class_docstr: Handle end-to-end training and deployment of user-provided TensorFlow code.
class_docstr_tok: ["Handle","end-to-end","training","and","deployment","of","user-provided","TensorFlow","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.
  
  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",".","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.
  
      Returns:
           dictionary: The transformed init_params
  
      """
      init_params = super(
          TensorFlow, cls
      )._prepare_init_params_from_job_description(
          job_details, model_channel_name
      )
  
      image_uri = init_params.pop("image_uri")
      (
          framework,
          py_version,
          tag,
          script_mode,
      ) = fw.framework_name_from_image(image_uri)
  
      if not framework:
          # If we were unable to parse the framework name from the image, it is not one of our
          # officially supported images, so just add the image to the init params.
          init_params["image_uri"] = image_uri
          return init_params
  
      model_dir = init_params["hyperparameters"].pop("model_dir", None)
      if model_dir:
          init_params["model_dir"] = model_dir
      elif script_mode is None:
          init_params["model_dir"] = False
  
      init_params["py_version"] = py_version
  
      # We switched image tagging scheme from regular image version (e.g. '1.0') to more
      # expressive containing framework version, device type and python version
      # (e.g. '1.5-gpu-py2'). For backward compatibility map deprecated image tag '1.0' to a
      # '1.4' framework version otherwise extract framework version from the tag itself.
      init_params["framework_version"] = (
          "1.4" if tag == "1.0" else fw.framework_version_from_tag(tag)
      )
  
      # Legacy images are required to be passed in explicitly.
      if not script_mode:
          init_params["image_uri"] = image_uri
  
      if framework != cls._framework_name:
          raise ValueError(
              "Training job: {} didn't use image for requested framework".format(
                  job_details["TrainingJobName"]
              )
          )
  
      return init_params
  
imports: from __future__ import absolute_import
  import logging
  from typing import Optional, Union, Dict
  from packaging import version
  from sagemaker import image_uris, s3, utils
  from sagemaker.deprecations import renamed_kwargs
  from sagemaker.estimator import Framework, EstimatorBase
  import sagemaker.fw_utils
  from sagemaker.tensorflow import defaults
  from sagemaker.tensorflow.model import TensorFlowModel
  from sagemaker.transformer import Transformer
  from sagemaker.vpc_utils import VPC_CONFIG_DEFAULT
  from sagemaker.workflow import is_pipeline_variable
  from sagemaker.tensorflow.training_compiler.config import TrainingCompilerConfig
  from sagemaker.workflow.entities import PipelineVariable
  from sagemaker.utils import format_tags
label_desc: Use image node_id 5 for calling the TensorFlow 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