Skip to content

Commit 4f4ad9e

Browse files
ramilbakhshyievaalekhpatel07
authored andcommitted
Re-order imports in Python tests to avoid crashing (facebookresearch#3806)
Summary: Pull Request resolved: facebookresearch#3806 No explanation for why this works but importing faiss prior to torch causing Python to crash on certain test cases under pytest. This is a temporary workaround with a full RCA required. Reviewed By: pankajsingh88 Differential Revision: D61956515 fbshipit-source-id: d33992d0b92e87d58ddff1f160990cba487b9927
1 parent b4865a2 commit 4f4ad9e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tests/torch_test_contrib.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
# This source code is licensed under the MIT license found in the
44
# LICENSE file in the root directory of this source tree.
55

6-
import faiss
76
import torch
87
import unittest
98
import numpy as np
9+
import faiss
1010
import faiss.contrib.torch_utils
1111

1212
class TestTorchUtilsCPU(unittest.TestCase):

tests/torch_test_neural_net.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
# This source code is licensed under the MIT license found in the
44
# LICENSE file in the root directory of this source tree.
55

6-
import faiss
76
import torch
87
from torch import nn
98
import unittest
109
import numpy as np
10+
import faiss
1111

1212
from faiss.contrib import datasets
1313
from faiss.contrib.inspect_tools import get_additive_quantizer_codebooks

0 commit comments

Comments
 (0)