parameters: (x: Tensor,
              dx: Tensor or float = 1,
              padding: Extrapolation = extrapolation.BOUNDARY,
              dims: tuple or None = None)
return_statement: return result
docstring: Spatial Laplace operator as defined for scalar fields.
      If a vector field is passed, the laplace is computed component-wise.
  
      Args:
          x: n-dimensional field of shape (batch, spacial dimensions..., components)
          dx: scalar or 1d tensor
          padding: extrapolation
          dims: The second derivative along these dimensions is summed over
  
      Returns:
          `phi.math.Tensor` of same shape as `x`
docstring_summary: Spatial Laplace operator as defined for scalar fields.
      If a vector field is passed, the laplace is computed component-wise.
docstring_tokens: Spatial Laplace operator as defined for scalar fields . If a vector field is passed the laplace is computed component - wise .
function: def laplace(x: Tensor,
              dx: Tensor or float = 1,
              padding: Extrapolation = extrapolation.BOUNDARY,
              dims: tuple or None = None):
      """
      Spatial Laplace operator as defined for scalar fields.
      If a vector field is passed, the laplace is computed component-wise.
  
      Args:
          x: n-dimensional field of shape (batch, spacial dimensions..., components)
          dx: scalar or 1d tensor
          padding: extrapolation
          dims: The second derivative along these dimensions is summed over
  
      Returns:
          `phi.math.Tensor` of same shape as `x`
  
      """
      if isinstance(dx, (tuple, list)):
          dx = wrap(dx, batch('_laplace'))
      elif isinstance(dx, Tensor) and dx.vector.exists:
          dx = math.rename_dims(dx, 'vector', batch('_laplace'))
      if isinstance(x, Extrapolation):
          return x.spatial_gradient()
      left, center, right = shift(wrap(x), (-1, 0, 1), dims, padding, stack_dim=batch('_laplace'))
      result = (left + right - 2 * center) / (dx ** 2)
      result = math.sum_(result, '_laplace')
      return result
function_tokens: def laplace ( x : Tensor , dx : Tensor or float = 1 , padding : Extrapolation = extrapolation . BOUNDARY , dims : tuple or None = None ) : if isinstance ( dx , ( tuple , list ) ) : dx = wrap ( dx , batch ( '_laplace' ) ) elif isinstance ( dx , Tensor ) and dx . vector . exists : dx = math . rename_dims ( dx , 'vector' , batch ( '_laplace' ) ) if isinstance ( x , Extrapolation ) : return x . spatial_gradient ( ) left , center , right = shift ( wrap ( x ) , ( - 1 , 0 , 1 ) , dims , padding , stack_dim = batch ( '_laplace' ) ) result = ( left + right - 2 * center ) / ( dx ** 2 ) result = math . sum_ ( result , '_laplace' ) return result