parameters: (
      logpsi: Callable,
      pars: PyTree,
      σ: Array,
      args: PyTree,
      *,
      chunk_size: Optional[int] = None,
  )
return_statement: return jnp.sum(mels * jnp.exp(logpsi_σp - logpsi_σ), axis=-1)
docstring: local_value kernel for MCState and generic operators
docstring_summary: local_value kernel for MCState and generic operators
docstring_tokens: local_value kernel for MCState and generic operators
function: def local_value_kernel_chunked(
      logpsi: Callable,
      pars: PyTree,
      σ: Array,
      args: PyTree,
      *,
      chunk_size: Optional[int] = None,
  ):
      """
      local_value kernel for MCState and generic operators
      """
      σp, mels = args
  
      if jnp.ndim(σp) != 3:
          σp = σp.reshape((σ.shape[0], -1, σ.shape[-1]))
          mels = mels.reshape(σp.shape[:-1])
  
      logpsi_chunked = nkjax.vmap_chunked(
          partial(logpsi, pars), in_axes=0, chunk_size=chunk_size
      )
      N = σ.shape[-1]
  
      logpsi_σ = logpsi_chunked(σ.reshape((-1, N))).reshape(σ.shape[:-1] + (1,))
      logpsi_σp = logpsi_chunked(σp.reshape((-1, N))).reshape(σp.shape[:-1])
  
      return jnp.sum(mels * jnp.exp(logpsi_σp - logpsi_σ), axis=-1)
function_tokens: def local_value_kernel_chunked ( logpsi : Callable , pars : PyTree , σ: rray, args : PyTree , * , chunk_size : Optional [ int ] = None , ) : σp, els  rgs if jnp . ndim ( σp) =  : σp  p.r e shape(( σ . sh a pe[0] , - 1 σ . ha p e[-1] ) ) mels = mels . reshape ( σp. s hape[ : - 1 ] ) logpsi_chunked = nkjax . vmap_chunked ( partial ( logpsi , pars ) , in_axes = 0 , chunk_size = chunk_size ) N = σ. s hape[ - 1 ] logpsi_σ  ogpsi_chunked( σ .r e shape(( - 1 , N ) ) . r e shape(σ . sh a pe[:- 1 ] + 1 ) ) logpsi_σp  ogpsi_chunked( σ p.r e shape(( - 1 , N ) ) . r e shape(σ p .sh a pe[:- 1 ] ) return jnp . sum ( mels * jnp . exp ( logpsi_σp  ogpsi_σ), a is=- 1 )