[Bug] Fix torch2 error (#536)

fix torch2 error
pull/542/head
humu789 2023-05-17 15:59:51 +08:00 committed by GitHub
parent 7586af005b
commit a578fad2bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -49,7 +49,9 @@ _ConvMetadata = namedtuple('_ConvMetadata', [
'relu_qat', 'bn_qat', 'bn_relu_qat', 'func'
])
if digit_version(torch.__version__) >= digit_version('1.13.0'):
if digit_version(
torch.__version__) >= digit_version('1.13.0') and digit_version(
torch.__version__) <= digit_version('1.13.1'):
_Conv1dMetadata = _ConvMetadata(
nn.Conv1d, nn.ConvTranspose1d, nn.BatchNorm1d, nnqr.Conv1d,
nnqr.ConvTranspose1d, nni.ConvReLU1d, nni.ConvBn1d, nni.ConvBnReLU1d,

View File

@ -7,7 +7,9 @@ from .native import get_native_backend_config
from .openvino import get_openvino_backend_config
from .tensorrt import get_tensorrt_backend_config
if digit_version(torch.__version__) >= digit_version('1.13.0'):
if digit_version(
torch.__version__) >= digit_version('1.13.0') and digit_version(
torch.__version__) <= digit_version('1.13.1'):
BackendConfigs = {
'academic': get_academic_backend_config(),
'native': get_native_backend_config(),