"git@developer.sourcefind.cn:change/sglang.git" did not exist on "f62055b528c2cac6cebdb6303e00bb479d7d2402"
Commit 4826cd62 authored by Hang Zhang's avatar Hang Zhang Committed by Facebook GitHub Bot
Browse files

Fix Torch Version Check for OSS Users

Summary: Pull Request resolved: https://github.com/facebookresearch/mobile-vision/pull/56

Reviewed By: ppwwyyxx

Differential Revision: D32576986

fbshipit-source-id: 1b20d1927a36ac80e33b51ff971b54767f647d43
parent 997bb727
...@@ -51,7 +51,7 @@ from mobile_cv.predictor.builtin_functions import ( ...@@ -51,7 +51,7 @@ from mobile_cv.predictor.builtin_functions import (
) )
TORCH_VERSION: Tuple[int, ...] = tuple(int(x) for x in torch.__version__.split(".")[:2]) TORCH_VERSION: Tuple[int, ...] = tuple(int(x) for x in torch.__version__.split(".")[:2])
if TORCH_VERSION >= (1, 10): if TORCH_VERSION > (1, 10):
from torch.ao.quantization import convert from torch.ao.quantization import convert
from torch.ao.quantization.quantize_fx import convert_fx from torch.ao.quantization.quantize_fx import convert_fx
else: else:
......
...@@ -19,7 +19,7 @@ from mobile_cv.arch.utils import fuse_utils ...@@ -19,7 +19,7 @@ from mobile_cv.arch.utils import fuse_utils
from mobile_cv.common.misc.iter_utils import recursive_iterate from mobile_cv.common.misc.iter_utils import recursive_iterate
TORCH_VERSION: Tuple[int, ...] = tuple(int(x) for x in torch.__version__.split(".")[:2]) TORCH_VERSION: Tuple[int, ...] = tuple(int(x) for x in torch.__version__.split(".")[:2])
if TORCH_VERSION >= (1, 10): if TORCH_VERSION > (1, 10):
from torch.ao.quantization.quantize_fx import convert_fx, prepare_fx, prepare_qat_fx from torch.ao.quantization.quantize_fx import convert_fx, prepare_fx, prepare_qat_fx
else: else:
from torch.quantization.quantize_fx import convert_fx, prepare_fx, prepare_qat_fx from torch.quantization.quantize_fx import convert_fx, prepare_fx, prepare_qat_fx
......
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