code: def __init__(
      self,
      module: linen.Module,
      *args: tp.Any,
      rngs: tp.Optional[Rngs] = None,
      **kwargs: tp.Any,
  ):
      self.module = module
  
      _rngs = (
          {name: stream.key for name, stream in rngs._rngs.items()}
          if rngs
          else {}
      )
      # rename default to params
      if "params" not in _rngs and "default" in _rngs:
          _rngs["params"] = _rngs["default"]
          del _rngs["default"]
  
      variables = module.init(_rngs, *args, **kwargs)
  
      self.states = helpers.Dict(
          (collection, variableslib.variable_type(collection)(value))
          for collection, value in variables.items()
      )
  
file_path: flax/flax/experimental/nnx/nnx/compatibility.py
imports: import dataclasses
  import typing
  from typing import Any
  from flax import linen
  from flax.experimental.nnx.nnx import helpers
  from flax.experimental.nnx.nnx import variables
  from flax.experimental.nnx.nnx.module import GraphDef, Module
  from flax.experimental.nnx.nnx.rnglib import Rngs
  from flax.experimental.nnx.nnx.state import State
label_desc: Use image node_id 1 to create a new LinenWrapper object from inherited base classes: Module with example: obj = LinenWrapper(module)