code: def _dot_general_validated_shape(
      lhs_shape: tuple[int, ...],
      rhs_shape: tuple[int, ...],
      dimension_numbers: DotDimensionNumbers,
  ) -> tuple[int, ...]:
      """Validate the inputs and return the output shape."""
      lhs = core.ShapedArray(lhs_shape, np.float32)
      rhs = core.ShapedArray(rhs_shape, np.float32)
      return _dot_general_shape_rule(
          lhs,
          rhs,
          dimension_numbers=dimension_numbers,
          precision=None,
          preferred_element_type=None,
      )
  
imports: import functools
  from typing import Any, NamedTuple, Union
  import numpy
  import jax
  from jax import lax
  from jax import tree_util
  from jax import vmap
  from jax._src import core
  from jax._src import dtypes
  from jax._src import stages
  from jax._src.api_util import flatten_axes
  import jax.numpy
  from jax.util import safe_zip
  from jax._src.lax.lax import _dot_general_shape_rule, DotDimensionNumbers
  from jax._src.typing import Array
label_desc: Use image node_id 8 for calling a global function with example usage: _dot_general_validated_shape(lhs_shape, rhs_shape, dimension_numbers) and returns: _dot_general_shape_rule