code: def fromfunction(function, shape, **kwargs):
      """Constructs an array by executing a function over each coordinate.
  
      This is currently equivalent to :func:`numpy.fromfunction`
      wrapped by :func:`chainerx.array`, given the device argument.
  
      Note:
          Keywords other than ``dtype`` and ``device`` are passed to
          ```function```.
  
      .. seealso:: :func:`numpy.fromfunction`
  
      """
      dtype = kwargs.pop("dtype", float)
      device = kwargs.pop("device", None)
      return chainerx.array(
          numpy.fromfunction(function, shape, dtype=dtype, **kwargs),
          device=device,
      )
  
file_path: chainer/chainerx/creation/from_data.py
imports: import numpy
  import chainerx
label_desc: Use image node_id 3 for calling a global function with example usage: fromfunction(function, shape) and returns: chainerx