class_docstr: An abstract base class, used by [`equinox.nn.Sequential`][], to mark that a
  layer might be stateful. If `Sequential` sees that a layer inherits from
  `StatefulLayer`, then it will call `layer.is_stateful()` to check whether to
  call the layer as `new_x = layer(x)` or `(new_x, new_state) = layer(x, state)`.
docstr: Indicates whether this layer should be considered stateful.
  
  The default implementation just returns True, but subclasses may override
  this to provide custom logic if the layer is only "maybe stateful". (E.g. if
  they optionally use stateful sublayers themselves.)
  
  **Arguments:**
  
  None
  
  **Returns:**
  
  A boolean. `True` indicates that the layer should be called as
  `(new_x, new_state) = layer(x, state)`. `False` indicates that the layer
  should be called as `new_x = layer(x)`.
docstr_tok: ["Indicates","whether","this","layer","should","be","considered","stateful",".","The","default","implementation","just","returns","True",",","but","subclasses","may","override","this","to","provide","custom","logic","if","the","layer","is","only","``","maybe","stateful","''",".","(","E.g",".","if","they","optionally","use","stateful","sublayers","themselves",".",")","*","*","Arguments",":","*","*","None","*","*","Returns",":","*","*","A","boolean",".","`","True","`","indicates","that","the","layer","should","be","called","as","`","(","new_x",",","new_state",")","=","layer","(","x",",","state",")","`",".","`","False","`","indicates","that","the","layer","should","be","called","as","`","new_x","=","layer","(","x",")","`","."]
code: def is_stateful(self) -> bool:
      """Indicates whether this layer should be considered stateful.
  
      The default implementation just returns True, but subclasses may override
      this to provide custom logic if the layer is only "maybe stateful". (E.g. if
      they optionally use stateful sublayers themselves.)
  
      **Arguments:**
  
      None
  
      **Returns:**
  
      A boolean. `True` indicates that the layer should be called as
      `(new_x, new_state) = layer(x, state)`. `False` indicates that the layer
      should be called as `new_x = layer(x)`.
      """
      return True
  
imports: from collections.abc import Callable, Sequence
  from typing import Any, Optional, overload, Union
  import jax
  import jax.random
  from jaxtyping import Array, PRNGKeyArray
  from .._better_abstract import AbstractClassVar
  from .._custom_types import sentinel
  from .._module import Module, StrictConfig
  from ._stateful import State
label_desc: Use image node_id 1 for calling the StatefulLayer obj's underlying member method code with example usage: obj.is_stateful() and returns: True