Unverified Commit 59c4de91 authored by Nicolas Hug's avatar Nicolas Hug Committed by GitHub
Browse files

fix submodule imports by importing functions directly (#6188)



Summary:
fixes two sporadic issues from missing attributes:

- breaking circular imports
- submodule not being imported explicitly

Reviewed By: ehhuang

Differential Revision: D37071652

fbshipit-source-id: 0680f098384b0fd21076339750e9d1a96186ede3
Co-authored-by: default avatarEdward Wang (EcoF) <hack@fb.com>
parent 28557e0c
...@@ -47,10 +47,10 @@ def _check_cuda_version(): ...@@ -47,10 +47,10 @@ def _check_cuda_version():
""" """
if not _HAS_OPS: if not _HAS_OPS:
return -1 return -1
import torch from torch.version import cuda as torch_version_cuda
_version = torch.ops.torchvision._cuda_version() _version = torch.ops.torchvision._cuda_version()
if _version != -1 and torch.version.cuda is not None: if _version != -1 and torch_version_cuda is not None:
tv_version = str(_version) tv_version = str(_version)
if int(tv_version) < 10000: if int(tv_version) < 10000:
tv_major = int(tv_version[0]) tv_major = int(tv_version[0])
...@@ -58,8 +58,7 @@ def _check_cuda_version(): ...@@ -58,8 +58,7 @@ def _check_cuda_version():
else: else:
tv_major = int(tv_version[0:2]) tv_major = int(tv_version[0:2])
tv_minor = int(tv_version[3]) tv_minor = int(tv_version[3])
t_version = torch.version.cuda t_version = torch_version_cuda.split(".")
t_version = t_version.split(".")
t_major = int(t_version[0]) t_major = int(t_version[0])
t_minor = int(t_version[1]) t_minor = int(t_version[1])
if t_major != tv_major or t_minor != tv_minor: if t_major != tv_major or t_minor != tv_minor:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment