docstr: The number of layers attribute retrieved from the model config. Override this for model configs where the
  number of layers attribute is not called `num_layers`.
docstr_tok: ["The","number","of","layers","attribute","retrieved","from","the","model","config",".","Override","this","for","model","configs","where","the","number","of","layers","attribute","is","not","called","`","num_layers","`","."]
code: def num_layers(self) -> int:
      """
      The number of layers attribute retrieved from the model config. Override this for model configs where the
      number of layers attribute is not called `num_layers`.
      """
      if not hasattr(self._config, "num_layers"):
          raise AttributeError(
              "could not find the number of layers attribute in the model configuration, override the num_layers"
              " property of the model OnnxConfig to solve this"
          )
      return self._config.num_layers
  
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 5 for calling the OnnxConfigWithPast obj's underlying member method code with example usage: obj.num_layers() and returns: self