def from_tensors(
        cls,
        train_data: Optional[Union[Collection[torch.Tensor], torch.Tensor]] = None,
        train_targets: Optional[Collection[Any]] = None,
        val_data: Optional[Union[Collection[torch.Tensor], torch.Tensor]] = None,
        val_targets: Optional[Sequence[Any]] = None,
        test_data: Optional[Collection[torch.Tensor]] = None,
        test_targets: Optional[Sequence[Any]] = None,
        predict_data: Optional[Union[Collection[torch.Tensor], torch.Tensor]] = None,
        target_formatter: Optional[TargetFormatter] = None,
        video_sampler: Type[Sampler] = torch.utils.data.SequentialSampler,
        input_cls: Type[Input] = VideoClassificationTensorsInput,
        predict_input_cls: Type[Input] = VideoClassificationTensorsPredictInput,
        transform: INPUT_TRANSFORM_TYPE = VideoClassificationInputTransform,
        transform_kwargs: Optional[Dict] = None,
        **data_module_kwargs: Any,
    ) -> "VideoClassificationData":
        """Load the :class:`~flash.video.classification.data.VideoClassificationData` from a dictionary containing
        PyTorch tensors representing input video frames and their corresponding targets.

        Input tensor(s) will be extracted from the ``input_field`` in the ``dict``.
        The targets will be extracted from the ``target_fields`` in the ``dict`` and can be in any of our
        :ref:`supported classification target formats <formatting_classification_targets>`.

        To learn how to customize the transforms applied for each stage, read our
        :ref:`customizing transforms guide <customizing_transforms>`.

        Args:
            train_data: The torch tensor or list of tensors to use when training.
            train_targets: The list of targets to use when training.
            val_data: The torch tensor or list of tensors to use when validating.
            val_targets: The list of targets to use when validating.
            test_data: The torch tensor or list of tensors to use when testing.
            test_targets: The list of targets to use when testing.
            predict_data: The torch tensor or list of tensors to use when predicting.
            train_data: A torch tensor or list of tensors to use when training.
            train_targets: The list of targets to use when training.
            target_formatter: Optionally provide a :class:`~flash.core.data.utilities.classification.TargetFormatter` to
                control how targets are handled. See :ref:`formatting_classification_targets` for more details.
            video_sampler: Sampler for the internal video container. This defines the order tensors are used and,
                if necessary, the distributed split.
            input_cls: The :class:`~flash.core.data.io.input.Input` type to use for loading the data.
            predict_input_cls: The :class:`~flash.core.data.io.input.Input` type to use for loading the prediction data.
            transform: The :class:`~flash.core.data.io.input_transform.InputTransform` type to use.
            transform_kwargs: Dict of keyword arguments to be provided when instantiating the transforms.
            data_module_kwargs: Additional keyword arguments to provide to the
                :class:`~flash.core.data.data_module.DataModule` constructor.

        Returns:
            The constructed :class:`~flash.video.classification.data.VideoClassificationData`.

        Examples
        ________

        .. doctest::

            >>> import torch
            >>> from flash import Trainer
            >>> from flash.video import VideoClassifier, VideoClassificationData
            >>> frame = torch.randint(low=0, high=255, size=(3, 5, 10, 10), dtype=torch.uint8, device="cpu")
            >>> datamodule = VideoClassificationData.from_tensors(
            ...     train_data=[frame, frame, frame],
            ...     train_targets=["fruit", "vegetable", "fruit"],
            ...     val_data=[frame, frame],
            ...     val_targets=["vegetable", "fruit"],
            ...     predict_data=[frame],
            ...     batch_size=1,
            ... )
            >>> datamodule.num_classes
            2
            >>> datamodule.labels
            ['fruit', 'vegetable']
            >>> model = VideoClassifier(backbone="x3d_xs", num_classes=datamodule.num_classes)
            >>> trainer = Trainer(fast_dev_run=True)
            >>> trainer.fit(model, datamodule=datamodule)  # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
            Training...
            >>> trainer.predict(model, datamodule=datamodule)  # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
            Predicting...

        .. testcleanup::

            >>> del frame

        """

        train_input = input_cls(
            RunningStage.TRAINING,
            train_data,
            train_targets,
            video_sampler=video_sampler,
            target_formatter=target_formatter,
        )
        target_formatter = getattr(train_input, "target_formatter", None)

        return cls(
            train_input,
            input_cls(
                RunningStage.VALIDATING,
                val_data,
                val_targets,
                video_sampler=video_sampler,
                target_formatter=target_formatter,
            ),
            input_cls(
                RunningStage.TESTING,
                test_data,
                test_targets,
                video_sampler=video_sampler,
                target_formatter=target_formatter,
            ),
            predict_input_cls(RunningStage.PREDICTING, predict_data),
            transform=transform,
            transform_kwargs=transform_kwargs,
            **data_module_kwargs,
        )
Load the :class:`~flash.video.classification.data.VideoClassificationData` from a dictionary containing
        PyTorch tensors representing input video frames and their corresponding targets.

        Input tensor(s) will be extracted from the ``input_field`` in the ``dict``.
        The targets will be extracted from the ``target_fields`` in the ``dict`` and can be in any of our
        :ref:`supported classification target formats <formatting_classification_targets>`.

        To learn how to customize the transforms applied for each stage, read our
        :ref:`customizing transforms guide <customizing_transforms>`.

        Args:
            train_data: The torch tensor or list of tensors to use when training.
            train_targets: The list of targets to use when training.
            val_data: The torch tensor or list of tensors to use when validating.
            val_targets: The list of targets to use when validating.
            test_data: The torch tensor or list of tensors to use when testing.
            test_targets: The list of targets to use when testing.
            predict_data: The torch tensor or list of tensors to use when predicting.
            train_data: A torch tensor or list of tensors to use when training.
            train_targets: The list of targets to use when training.
            target_formatter: Optionally provide a :class:`~flash.core.data.utilities.classification.TargetFormatter` to
                control how targets are handled. See :ref:`formatting_classification_targets` for more details.
            video_sampler: Sampler for the internal video container. This defines the order tensors are used and,
                if necessary, the distributed split.
            input_cls: The :class:`~flash.core.data.io.input.Input` type to use for loading the data.
            predict_input_cls: The :class:`~flash.core.data.io.input.Input` type to use for loading the prediction data.
            transform: The :class:`~flash.core.data.io.input_transform.InputTransform` type to use.
            transform_kwargs: Dict of keyword arguments to be provided when instantiating the transforms.
            data_module_kwargs: Additional keyword arguments to provide to the
                :class:`~flash.core.data.data_module.DataModule` constructor.

        Returns:
            The constructed :class:`~flash.video.classification.data.VideoClassificationData`.

        Examples
        ________

        .. doctest::

            >>> import torch
            >>> from flash import Trainer
            >>> from flash.video import VideoClassifier, VideoClassificationData
            >>> frame = torch.randint(low=0, high=255, size=(3, 5, 10, 10), dtype=torch.uint8, device="cpu")
            >>> datamodule = VideoClassificationData.from_tensors(
            ...     train_data=[frame, frame, frame],
            ...     train_targets=["fruit", "vegetable", "fruit"],
            ...     val_data=[frame, frame],
            ...     val_targets=["vegetable", "fruit"],
            ...     predict_data=[frame],
            ...     batch_size=1,
            ... )
            >>> datamodule.num_classes
            2
            >>> datamodule.labels
            ['fruit', 'vegetable']
            >>> model = VideoClassifier(backbone="x3d_xs", num_classes=datamodule.num_classes)
            >>> trainer = Trainer(fast_dev_run=True)
            >>> trainer.fit(model, datamodule=datamodule)  # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
            Training...
            >>> trainer.predict(model, datamodule=datamodule)  # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
            Predicting...

        .. testcleanup::

            >>> del frame

        
src/flash/video/classification/data.py