code: def test_pca():
      pca = torchdrift.reducers.PCAReducer(n_components=2)
      assert "n_components" in str(pca)
      a = torch.randn(100, 50, dtype=torch.double)
      red = pca.fit(a)
      pca_ref = sklearn.decomposition.PCA(n_components=2)
      red_ref = torch.from_numpy(pca_ref.fit_transform(a))
      # need to find a way to deal with signs
      torch.testing.assert_allclose(red.abs(), red_ref.abs())
      b = torch.randn(25, 50, dtype=torch.double)
      red2 = pca(b)
      red2_ref = torch.from_numpy(pca_ref.transform(b))
  
imports: import pytest
  import torchdrift
  import torch
  import sklearn.decomposition
label_desc: Use image node_id 1 for calling a global function with example usage: test_pca() without return types