class_docstr: A continuous discretization. This discretization assumes that the field is a
  function of the parameters contained in `Continuous.params` and a point in the
  domain. The function that computes the field from the parameters and the point in
  the domain is contained in `Continuous.get_fun`. This function has the signature
  `get_fun(params, x)`, where `params` is the parameter vector and `x` is the point
  in the domain.
class_docstr_tok: ["A","continuous","discretization",".","This","discretization","assumes","that","the","field","is","a","function","of","the","parameters","contained","in","`","Continuous.params","`","and","a","point","in","the","domain",".","The","function","that","computes","the","field","from","the","parameters","and","the","point","in","the","domain","is","contained","in","`","Continuous.get_fun","`",".","This","function","has","the","signature","`","get_fun","(","params",",","x",")","`",",","where","`","params","`","is","the","parameter","vector","and","`","x","`","is","the","point","in","the","domain","."]
docstr: Creates a continuous discretization from an `init_fun` function.
  
  Args:
    domain (Domain): The domain of the discretization.
    init_fun (Callable): A function that initializes the parameters of the
      discretization. The signature of this function is `init_fun(rng, domain)`.
    get_field (Callable): A function that takes a parameter vector and a point in
      the domain and returns the field at that point. The signature of this
      function is `get_field(params, x)`.
    seed (int): The seed for the random number generator.
  
  Returns:
    Continuous: A continuous discretization.
docstr_tok: ["Creates","a","continuous","discretization","from","an","`","init_fun","`","function",".","Args",":","domain","(","Domain",")",":","The","domain","of","the","discretization",".","init_fun","(","Callable",")",":","A","function","that","initializes","the","parameters","of","the","discretization",".","The","signature","of","this","function","is","`","init_fun","(","rng",",","domain",")","`",".","get_field","(","Callable",")",":","A","function","that","takes","a","parameter","vector","and","a","point","in","the","domain","and","returns","the","field","at","that","point",".","The","signature","of","this","function","is","`","get_field","(","params",",","x",")","`",".","seed","(","int",")",":","The","seed","for","the","random","number","generator",".","Returns",":","Continuous",":","A","continuous","discretization","."]
code: def from_function(
      cls, domain, init_fun: Callable, get_field: Callable, seed
  ):
      r"""Creates a continuous discretization from an `init_fun` function.
  
      Args:
        domain (Domain): The domain of the discretization.
        init_fun (Callable): A function that initializes the parameters of the
          discretization. The signature of this function is `init_fun(rng, domain)`.
        get_field (Callable): A function that takes a parameter vector and a point in
          the domain and returns the field at that point. The signature of this
          function is `get_field(params, x)`.
        seed (int): The seed for the random number generator.
  
      Returns:
        Continuous: A continuous discretization.
      """
      params = init_fun(seed, domain)
      return cls(params, domain=domain, get_fun=get_field)
  
imports: import warnings
  from typing import Callable, TypeVar
  import equinox
  from equinox import tree_equal
  from jax import eval_shape
  from jax import numpy
  from jax import vmap
  from jaxtyping import PyTree
  from jaxdf.core import Field
  from jaxdf.geometry import Domain
label_desc: Use image node_id 6 for calling the Continuous obj's underlying member method code with example usage: obj.from_function(cls, domain, init_fun, get_field, seed) and returns: cls