code: def test_classification_outputs_fiftyone():
      logits = torch.tensor([-0.1, 0.2, 0.3])
      example_output = {
          DataKeys.PREDS: logits,
          DataKeys.METADATA: {"filepath": "something"},
      }  # 3 classes
      labels = ["class_1", "class_2", "class_3"]
  
      predictions = FiftyOneLabelsOutput(
          return_filepath=True
      ).transform(example_output)
      assert predictions["predictions"].label == "2"
      assert predictions["filepath"] == "something"
      predictions = FiftyOneLabelsOutput(
          labels, return_filepath=True
      ).transform(example_output)
      assert predictions["predictions"].label == "class_3"
      assert predictions["filepath"] == "something"
  
      predictions = FiftyOneLabelsOutput(
          store_logits=True, return_filepath=False
      ).transform(example_output)
      assert torch.allclose(
          torch.tensor(predictions.logits).to(logits.dtype), logits
      )
      assert torch.allclose(
          torch.tensor(predictions.confidence),
          torch.softmax(logits, -1)[-1],
      )
      assert predictions.label == "2"
      predictions = FiftyOneLabelsOutput(
          labels, store_logits=True, return_filepath=False
      ).transform(example_output)
      assert predictions.label == "class_3"
  
      predictions = FiftyOneLabelsOutput(
          store_logits=True, multi_label=True, return_filepath=False
      ).transform(example_output)
      assert torch.allclose(
          torch.tensor(predictions.logits).to(logits.dtype), logits
      )
      assert [c.label for c in predictions.classifications] == [
          "1",
          "2",
      ]
      predictions = FiftyOneLabelsOutput(
          labels, multi_label=True, return_filepath=False
      ).transform(example_output)
      assert [c.label for c in predictions.classifications] == [
          "class_2",
          "class_3",
      ]
  
file_path: lightning-flash/tests/core/test_classification.py
imports: import pytest
  import torch
  from flash.core.classification import ClassesOutput, FiftyOneLabelsOutput, LabelsOutput, LogitsOutput, ProbabilitiesOutput
  from flash.core.data.io.input import DataKeys
  from flash.core.utilities.imports import _FIFTYONE_AVAILABLE, _TOPIC_CORE_AVAILABLE, _TOPIC_IMAGE_AVAILABLE
label_desc: Use image node_id 3 for calling a global function with example usage: test_classification_outputs_fiftyone() without return types