class_docstr: Create a factory object that invokes a function with a frozen context.
  
  Parameters
  ----------
  callable
      The function to be invoked.
  sample
      The sample to be used as the frozen context.
  
  Examples
  --------
  >>> factory = frozen_factory(ModelSpaceClass, {"choice1": 3})
  >>> model = factory(channels=16, classes=10)
class_docstr_tok: ["Create","a","factory","object","that","invokes","a","function","with","a","frozen","context",".","Parameters","--","--","--","--","--","callable","The","function","to","be","invoked",".","sample","The","sample","to","be","used","as","the","frozen","context",".","Examples","--","--","--","--",">",">",">","factory","=","frozen_factory","(","ModelSpaceClass",",","{","``","choice1","''",":","3","}",")",">",">",">","model","=","factory","(","channels=16",",","classes=10",")"]
code: def __call__(self, *init_args, **init_kwargs):
      with self.sample:
          return self.callable(*init_args, **init_kwargs)
  
file_path: nni/nni/mutable/frozen.py
imports: from __future__ import annotations
  import logging
  from contextlib import contextmanager
  from typing import Any, Callable
  from .mutable import Mutable, Sample
  from .utils import NoContextError, ContextStack
label_desc: Use image node_id 2 for calling the frozen_factory obj's underlying member method code with example usage: obj.__call__() and returns: self