mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-14 20:57:59 +00:00
This PR adds bazel python, so that bazel build could be used from python like `import torch`. Notable changes: - Add the python targets. - Add the version.py.tpl generation. - In order to archive the `USE_GLOBAL_DEPS = False` just for the bazel build, employ a monkey-patch hack in the mentioned `version.py.tpl`. Pull Request resolved: https://github.com/pytorch/pytorch/pull/101003 Approved by: https://github.com/huydhn
15 lines
394 B
Python
15 lines
394 B
Python
# Owner(s): ["module: bazel"]
|
|
|
|
"""
|
|
This test module contains a minimalistic "smoke tests" for the bazel build.
|
|
|
|
Currently it doesn't use any testing framework (i.e. pytest)
|
|
TODO: integrate this into the existing pytorch testing framework.
|
|
"""
|
|
|
|
import torch
|
|
|
|
def test_sum():
|
|
assert torch.eq(torch.tensor([[1, 2, 3]]) + torch.tensor([[4, 5, 6]]), torch.tensor([[5, 7, 9]])).all()
|
|
|
|
test_sum()
|