code: def duplicate_input(sample):
      if "net_input" in sample.keys():
          sample_input = sample["net_input"]
      else:
          sample_input = sample
  
      for k, v in sample_input.items():
          if isinstance(v, torch.Tensor):
              sample_input[k] = torch.cat([v, v.clone()], dim=0)
      if "net_input" in sample.keys():
          sample["net_input"] = sample_input
      else:
          sample = sample_input
      return sample
  
file_path: fairseq/fairseq/criterions/label_smoothed_cross_entropy_with_rdrop.py
imports: import math
  from dataclasses import dataclass, field
  import torch
  from fairseq import utils
  from fairseq.logging import metrics
  from fairseq.criterions import register_criterion
  from fairseq.criterions.label_smoothed_cross_entropy import LabelSmoothedCrossEntropyCriterion, LabelSmoothedCrossEntropyCriterionConfig, label_smoothed_nll_loss
label_desc: Use image node_id 1 for calling a global function with example usage: duplicate_input(sample) and returns: sample