code: def _riemann_integral(
      x: torch.Tensor, y: torch.Tensor
  ) -> torch.Tensor:
      """Riemann integral approximates the area of each cell with a rectangle positioned at the egde.
      It is conventionally used rather than trapezoid approximation, which uses a rectangle positioned in the
      center"""
      return -torch.sum((x[1:] - x[:-1]) * y[:-1])
  
imports: from functools import partial
  from typing import Any, cast, Dict, List, Optional, Type
  import torch
  import torch.distributed
  import torch.nn.functional
  from torchrec.metrics.metrics_config import RecComputeMode, RecTaskInfo
  from torchrec.metrics.metrics_namespace import MetricName, MetricNamespace, MetricPrefix
  from torchrec.metrics.rec_metric import MetricComputationReport, RecMetric, RecMetricComputation, RecMetricException
label_desc: Use image node_id 1 for calling a global function with example usage: _riemann_integral(x, y) and returns: unknown