code: def ensure_shape(input: ShapeTensor) -> MutableShape:
      if input.real_shape is not None:
          return input.real_shape
      raise ValueError(f"Shape of input is not known: f{input}")
  
imports: from __future__ import annotations
  import logging
  import warnings
  from typing import Callable, Type, Tuple, Any, cast
  import torch
  from torch import nn
  import nni.nas.nn.pytorch
  from nni.mutable import MutableExpression
  from .shape import Formula, ShapeTensor, MutableShape, extract_shape_info, switch_case_shape_info, shape_inference
  from ._attrs import _getattr, tuple_2_t
label_desc: Use image node_id 4 for calling a global function with example usage: ensure_shape(input) and returns: input