code: def aggregate_moment(h, n=3, **kwargs):
      """
      Compute the nth moment of the input tensor along the second to last dimension.
  
      Parameters
      ----------
      h : torch.Tensor
          Input tensor.
      n : int, optional, default=3
          The order of the moment to compute.
  
      Returns
      -------
      torch.Tensor
          Nth moment of the input tensor along the second to last dimension.
      """
      # for each node (E[(X-E[X])^n])^{1/n}
      # EPS is added to the absolute value of expectation before taking the nth root for stability
      h_mean = torch.mean(h, dim=-2, keepdim=True)
      h_n = torch.mean(torch.pow(h - h_mean, n), dim=-2)
      rooted_h_n = torch.sign(h_n) * torch.pow(
          torch.abs(h_n) + EPS, 1.0 / n
      )
      return rooted_h_n
  
file_path: deepchem/deepchem/utils/graph_utils.py
imports: import numpy
label_desc: Use image node_id 7 for calling a global function with example usage: aggregate_moment(h, n) and returns: rooted_h_n