docstr: Fill the input_or_outputs mapping with past_key_values dynamic axes considering.
  
  Args:
      inputs_or_outputs: The mapping to fill.
      direction: either "inputs" or "outputs", it specifies whether input_or_outputs is the input mapping or the
          output mapping, this is important for axes naming.
      inverted_values_shape:
          If `True`, store values on dynamic axis 1, else on axis 2.
docstr_tok: ["Fill","the","input_or_outputs","mapping","with","past_key_values","dynamic","axes","considering",".","Args",":","inputs_or_outputs",":","The","mapping","to","fill",".","direction",":","either","``","inputs","''","or","``","outputs","''",",","it","specifies","whether","input_or_outputs","is","the","input","mapping","or","the","output","mapping",",","this","is","important","for","axes","naming",".","inverted_values_shape",":","If","`","True","`",",","store","values","on","dynamic","axis","1",",","else","on","axis","2","."]
code: def fill_with_past_key_values_(
      self,
      inputs_or_outputs: Mapping[str, Mapping[int, str]],
      direction: str,
      inverted_values_shape: bool = False,
  ):
      """
      Fill the input_or_outputs mapping with past_key_values dynamic axes considering.
  
      Args:
          inputs_or_outputs: The mapping to fill.
          direction: either "inputs" or "outputs", it specifies whether input_or_outputs is the input mapping or the
              output mapping, this is important for axes naming.
          inverted_values_shape:
              If `True`, store values on dynamic axis 1, else on axis 2.
  
      """
      if direction not in ["inputs", "outputs"]:
          raise ValueError(
              f'direction must either be "inputs" or "outputs", but {direction} was given'
          )
  
      name = "past_key_values" if direction == "inputs" else "present"
      for i in range(self.num_layers):
          inputs_or_outputs[f"{name}.{i}.key"] = {
              0: "batch",
              2: "past_sequence + sequence",
          }
          if inverted_values_shape:
              inputs_or_outputs[f"{name}.{i}.value"] = {
                  0: "batch",
                  1: "past_sequence + sequence",
              }
          else:
              inputs_or_outputs[f"{name}.{i}.value"] = {
                  0: "batch",
                  2: "past_sequence + sequence",
              }
  
imports: import copy
  import dataclasses
  import warnings
  from abc import ABC, abstractmethod
  from collections import OrderedDict
  from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Mapping, Optional, Tuple, Union
  import numpy
  from packaging import version
  from ..utils import TensorType, is_torch_available, is_vision_available, logging
  from .utils import ParameterFormat, compute_effective_axis_dimension, compute_serialized_parameters_size
label_desc: Use image node_id 8 for calling the OnnxConfigWithPast obj's underlying member method code with example usage: obj.fill_with_past_key_values_(inputs_or_outputs, direction, inverted_values_shape) without return types