class_docstr: PyTorch module, but with uncertainties.
  
  This base class provides useful tools to handle search spaces built on top of PyTorch modules,
  including methods like :meth:`simplify`, :meth:`freeze`.
  
  :class:`MutableModule` can have dangling mutables registered on it via :meth:`add_mutable`.
class_docstr_tok: ["PyTorch","module",",","but","with","uncertainties",".","This","base","class","provides","useful","tools","to","handle","search","spaces","built","on","top","of","PyTorch","modules",",","including","methods","like",":","meth",":","`","simplify","`",",",":","meth",":","`","freeze","`",".",":","class",":","`","MutableModule","`","can","have","dangling","mutables","registered","on","it","via",":","meth",":","`","add_mutable","`","."]
code: def __new__(cls, *args, **kwargs):
      # The purpose of __new__ is to intercept module creation,
      # and create other types of modules when necessary.
  
      arch = current_model()
      if cls.should_invoke_fixed_module() and arch is not None:
          # If within a fixed_arch context, create the frozen module.
          # It must return a object with different type, or else infinite recursion will happen.
          return cls.create_fixed_module(arch, *args, **kwargs)  # type: ignore
      else:
          return super().__new__(cls)
  
imports: import copy
  import itertools
  import inspect
  import logging
  from typing import Any, Callable, Type, Iterable, Dict, Tuple, List, Optional, TypeVar
  import torch
  from torch import nn
  from nni.mutable import Mutable, LabeledMutable, Sample, SampleValidationError, ensure_frozen, frozen_context, label_scope, frozen
  from nni.nas.space import BaseModelSpace, current_model, model_context
  from nni.common.serializer import SerializableObject, _formulate_arguments, _copy_class_wrapper_attributes
label_desc: Use image node_id 1 for calling the MutableModule obj's underlying member method code with example usage: obj.__new__(cls) and returns: cls, super