parameters: (external_match: dict, internal_match: dict)
docstring: Transforms TensorFlow 2 input slicing into use of axis attribute for input port of Loop node
          :param external_match: a match used for handling a part of the main graph responsible for input slicing
          :param internal_match: a match used for handling a part of the body graph responsible for input slicing
docstring_summary: Transforms TensorFlow 2 input slicing into use of axis attribute for input port of Loop node
          :param external_match: a match used for handling a part of the main graph responsible for input slicing
          :param internal_match: a match used for handling a part of the body graph responsible for input slicing
docstring_tokens: Transforms TensorFlow 2 input slicing into use of axis attribute for input port of Loop node : param external_match : a match used for handling a part of the main graph responsible for input slicing : param internal_match : a match used for handling a part of the body graph responsible for input slicing
function: def transform_map_fn_input_slicing(external_match: dict, internal_match: dict):
          """
          Transforms TensorFlow 2 input slicing into use of axis attribute for input port of Loop node
          :param external_match: a match used for handling a part of the main graph responsible for input slicing
          :param internal_match: a match used for handling a part of the body graph responsible for input slicing
          """
          loop_node = external_match['while']
          unstack_node = external_match['unstack']
          body_graph = loop_node['body']
  
          tensor_list_get_item_node = internal_match['slicing']
          unstack_placeholder = internal_match['tensor_list']
          tensor_list_get_item_node_name = tensor_list_get_item_node.soft_get('name', tensor_list_get_item_node.id)
  
          # 1. process the body graph to avoid unsupported operations: TensorListGetItem and TensorListSetItem
          # replace TensorListGetItem with Squeeze node and iterate through slices using axis for input port
          squeeze_list_element = create_op_with_const_inputs(body_graph, Squeeze, {1: int64_array(0)},
                                                             {'name': 'TensorListGetItemSqueeze'})
          tensor_list_get_item_node.in_port(0).get_connection().set_destination(squeeze_list_element.in_port(0))
          tensor_list_get_item_node.out_port(0).get_connection().set_source(squeeze_list_element.out_port(0))
          rename_nodes([(tensor_list_get_item_node, tensor_list_get_item_node_name + '/AbandonedName'),
                        (squeeze_list_element, tensor_list_get_item_node_name)])
          unstack_placeholder_layer_id = unstack_placeholder.internal_layer_id
          Loop.update_port_map_value_ext(loop_node.input_port_map, 'internal_layer_id', unstack_placeholder_layer_id,
                                         'axis', 0)
  
          # 2. process locality of Loop node in the main graph to avoid unsupported operations:
          # TensorListFromTensor, TensorListReserve, and TensorListStack
          # remove TensorListFromTensor and pass a tensor to Loop as is
          unstack_node.out_port(0).get_connection().set_source(unstack_node.in_port(0).get_connection().get_source())
function_tokens: def transform_map_fn_input_slicing ( external_match : dict , internal_match : dict ) : loop_node = external_match [ 'while' ] unstack_node = external_match [ 'unstack' ] body_graph = loop_node [ 'body' ] tensor_list_get_item_node = internal_match [ 'slicing' ] unstack_placeholder = internal_match [ 'tensor_list' ] tensor_list_get_item_node_name = tensor_list_get_item_node . soft_get ( 'name' , tensor_list_get_item_node . id ) # 1. process the body graph to avoid unsupported operations: TensorListGetItem and TensorListSetItem # replace TensorListGetItem with Squeeze node and iterate through slices using axis for input port squeeze_list_element = create_op_with_const_inputs ( body_graph , Squeeze , { 1 : int64_array ( 0 ) } , { 'name' : 'TensorListGetItemSqueeze' } ) tensor_list_get_item_node . in_port ( 0 ) . get_connection ( ) . set_destination ( squeeze_list_element . in_port ( 0 ) ) tensor_list_get_item_node . out_port ( 0 ) . get_connection ( ) . set_source ( squeeze_list_element . out_port ( 0 ) ) rename_nodes ( [ ( tensor_list_get_item_node , tensor_list_get_item_node_name + '/AbandonedName' ) , ( squeeze_list_element , tensor_list_get_item_node_name ) ] ) unstack_placeholder_layer_id = unstack_placeholder . internal_layer_id Loop . update_port_map_value_ext ( loop_node . input_port_map , 'internal_layer_id' , unstack_placeholder_layer_id , 'axis' , 0 ) # 2. process locality of Loop node in the main graph to avoid unsupported operations: # TensorListFromTensor, TensorListReserve, and TensorListStack # remove TensorListFromTensor and pass a tensor to Loop as is unstack_node . out_port ( 0 ) . get_connection ( ) . set_source ( unstack_node . in_port ( 0 ) . get_connection ( ) . get_source ( ) )