class_docstr: The ``PyTorchForecastingAdapter`` is an :class:`~flash.core.adapter.Adapter` for integrating with PyTorch
  Forecasting.
class_docstr_tok: ["The","``","PyTorchForecastingAdapter","``","is","an",":","class",":","`","~flash.core.adapter.Adapter","`","for","integrating","with","PyTorch","Forecasting","."]
code: def _collate_fn(collate_fn, samples):
      samples = [
          (sample[DataKeys.INPUT], sample[DataKeys.TARGET])
          for sample in samples
      ]
      batch = collate_fn(samples)
      return {DataKeys.INPUT: batch[0], DataKeys.TARGET: batch[1]}
  
imports: from copy import copy
  from functools import partial
  from typing import Any, Callable, Dict, List, Optional, Union
  import torchmetrics
  from torch import Tensor
  from flash.core.adapter import Adapter
  from flash.core.data.batch import default_uncollate
  from flash.core.data.io.input import DataKeys
  from flash.core.model import Task
  from flash.core.utilities.imports import _FORECASTING_AVAILABLE, _PANDAS_AVAILABLE
label_desc: Use image node_id 2 for calling the PyTorchForecastingAdapter obj's underlying member method code with example usage: obj._collate_fn(collate_fn, samples) and returns: dict