code: def get_position_discounts(t: torch.Tensor) -> torch.Tensor:
      orders = torch.argsort(torch.argsort(t, descending=True))
      return torch.reciprocal(torch.log2(orders.add(2.0))).type(
          torch.double
      )
  
imports: from typing import Any, cast, Dict, List, Optional, Type
  import torch
  from torch import distributed
  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 4 for calling a global function with example usage: get_position_discounts(t) and returns: torch