code: def test_compute_fid_from_features():
      train_samples, test_samples = torch.rand(10, 10), torch.rand(
          10, 10
      )
  
      fid_scorer = FID(
          num_features=10, feature_extractor=torch.nn.Identity()
      )
      fid_scorer.update([train_samples[:5], test_samples[:5]])
      fid_scorer.update([train_samples[5:], test_samples[5:]])
  
      mu1, sigma1 = train_samples.mean(axis=0), cov(
          train_samples, rowvar=False
      )
      mu2, sigma2 = test_samples.mean(axis=0), cov(
          test_samples, rowvar=False
      )
  
      assert (
          pytest.approx(
              pytorch_fid_score.calculate_frechet_distance(
                  mu1, sigma1, mu2, sigma2
              ),
              rel=1e-5,
          )
          == fid_scorer.compute()
      )
  
imports: import os
  import re
  from unittest.mock import patch
  import pytest
  import pytorch_fid.fid_score
  import scipy
  import torch
  from numpy import cov
  import ignite.distributed
  from ignite.metrics.gan.fid import FID, fid_score
label_desc: Use image node_id 6 for calling a global function with example usage: test_compute_fid_from_features() without return types