class_docstr: Turn a function into a Module by keeping the vars it uses.
class_docstr_tok: ["Turn","a","function","into","a","Module","by","keeping","the","vars","it","uses","."]
docstr: Turns a function into a module by auto detecting used Objax variables. Could be used as a decorator.
  
  WARNING: This is an experimental feature.
  It can detect variables used by function in many common cases, but not all cases.
  This feature may be removed in the future version of Objax if it appear to be too unreliable.
  
  Args:
      f: function which will be converted into a module.
docstr_tok: ["Turns","a","function","into","a","module","by","auto","detecting","used","Objax","variables",".","Could","be","used","as","a","decorator",".","WARNING",":","This","is","an","experimental","feature",".","It","can","detect","variables","used","by","function","in","many","common","cases",",","but","not","all","cases",".","This","feature","may","be","removed","in","the","future","version","of","Objax","if","it","appear","to","be","too","unreliable",".","Args",":","f",":","function","which","will","be","converted","into","a","module","."]
code: def auto_vars(f: Callable):
      """Turns a function into a module by auto detecting used Objax variables. Could be used as a decorator.
  
      WARNING: This is an experimental feature.
      It can detect variables used by function in many common cases, but not all cases.
      This feature may be removed in the future version of Objax if it appear to be too unreliable.
  
      Args:
          f: function which will be converted into a module.
      """
      from objax.util.tracing import find_used_variables
  
      return Function(f, find_used_variables(f))
  
imports: from collections import namedtuple
  from typing import Optional, List, Union, Callable, Tuple
  import jax
  import jax.numpy
  import numpy
  from objax.typing import JaxArray
  from objax.util import class_name, override_args_kwargs, positional_args_names, repr_function
  from objax.variable import BaseVar, RandomState, VarCollection
label_desc: Use image node_id 5 for calling the Function obj's underlying member method code with example usage: obj.auto_vars(f) and returns: Function