code: def _sum(x, axis, keepdims):
      if axis is None and not keepdims:
          return torch.sum(x)
      axis = tuple(range(x.dim())) if axis is None else axis
      return torch.sum(x, axis, keepdim=keepdims)
  
imports: import numbers
  import typing
  import torch
  import funsor.ops
label_desc: Use image node_id 6 for calling a global function with example usage: _sum(x, axis, keepdims) and returns: torch, torch