class_docstr: Base test class for StableHLO quant tests.
class_docstr_tok: ["Base","test","class","for","StableHLO","quant","tests","."]
code: def _prepare_sample_einsum_datashapes(
      self,
      equation: str,
      generate_unknown_shape_signature: bool = False,
      use_bias: bool = False,
  ) -> Tuple[
      List[Optional[int]],
      List[Optional[int]],
      Optional[List[Optional[int]]],
      List[Optional[int]],
      List[Optional[int]],
  ]:
      # 1. Parse equation.
      comma_pos = equation.find(",")
      arrow_pos = equation.find("->")
      x_labels = equation[0:comma_pos]
      y_labels = equation[comma_pos + 1 : arrow_pos]
      out_labels = equation[arrow_pos + 1 :]
  
      # 2. Create sample shapes.
      label_to_size = {"a": 4, "b": 32, "c": 64, "d": 128, "e": 8}
      x_shape = [label_to_size.get(x_label) for x_label in x_labels]
      y_shape = [label_to_size.get(y_label) for y_label in y_labels]
      bias_shape = None
      if use_bias:
          bias_shape = [
              label_to_size.get(out_label) for out_label in out_labels
          ]
          bias_shape = bias_shape[-1:]
      contracting_dims = set()
  
      x_signature = list(x_shape)
      y_signature = list(y_shape)
      if generate_unknown_shape_signature:
          for c in x_labels:
              if c in y_labels:
                  contracting_dims.add(c)
          x_signature = [
              None if c not in contracting_dims else x_shape[cidx]
              for cidx, c in enumerate(x_labels)
          ]
          y_signature = [
              None if c not in contracting_dims else y_shape[cidx]
              for cidx, c in enumerate(y_labels)
          ]
      return x_shape, y_shape, bias_shape, x_signature, y_signature
  
imports: from typing import Mapping, Sequence, Optional, Tuple, List
  from absl.testing import parameterized
  import numpy
  import tensorflow
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor_spec
  from tensorflow.python.module import module
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import nn_ops
  from tensorflow.python.platform import test
  from tensorflow.python.saved_model import save
  from tensorflow.python.types import core
label_desc: Use image node_id 5 for calling the QuantizedModelTest obj's underlying member method code with example usage: obj._prepare_sample_einsum_datashapes(equation, generate_unknown_shape_signature, use_bias) and returns: x_shape,  y_shape,  bias_shape,  x_signature,  y_signature