• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Owner(s): ["module: onnx"]
2"""Unit tests for the _tensors module."""
3
4from __future__ import annotations
5
6import onnxscript
7
8from torch.onnx._internal.exporter import _tensors
9from torch.testing._internal import common_utils
10
11
12class SymbolicTensorTest(common_utils.TestCase):
13    def test_it_is_hashable(self):
14        tensor = _tensors.SymbolicTensor(
15            opset=onnxscript.values.Opset(domain="test", version=1)
16        )
17        self.assertEqual(hash(tensor), hash(tensor))
18        self.assertIn(tensor, {tensor})
19
20
21if __name__ == "__main__":
22    common_utils.run_tests()
23