code: def update_dimension(model, input_dimension):
      """
      Given a model that takes an array of dimension input_dimension, returns
      the output dimension.
      """
      if not (_HAS_SKLEARN):
          raise RuntimeError(
              "scikit-learn not found. scikit-learn conversion API is disabled."
          )
  
      if _SKLEARN_VERSION >= StrictVersion("0.22"):
          _sklearn_util.check_fitted(
              model, lambda m: hasattr(m, "categories_")
          )
          _sklearn_util.check_fitted(
              model, lambda m: hasattr(m, "n_features_in_")
          )
          return sum(model._n_features_outs)
      else:
          _sklearn_util.check_fitted(
              model, lambda m: hasattr(m, "active_features_")
          )
          _sklearn_util.check_fitted(
              model, lambda m: hasattr(m, "n_values_")
          )
  
          if model.categorical_features == "all":
              return len(model.active_features_)
          else:
              out_dimension = len(model.active_features_) + (
                  input_dimension - len(model.n_values_)
              )
  
              return out_dimension
  
file_path: coremltools/coremltools/converters/sklearn/_one_hot_encoder.py
imports: from ...None import SPECIFICATION_VERSION
  from ..._deps import _HAS_SKLEARN, _SKLEARN_VERSION
  from ...models import MLModel
  from ...models import datatypes
  from ...models._interface_management import set_transform_interface_params
  from ...models.array_feature_extractor import create_array_feature_extractor
  from ...models.feature_vectorizer import create_feature_vectorizer
  from ...models.pipeline import Pipeline
  from ...proto import Model_pb2
  from ...proto import OneHotEncoder_pb2
  from .None import _sklearn_util
label_desc: Use image node_id 2 for calling a global function with example usage: update_dimension(model, input_dimension) and returns: sum, len, out_dimension