提交 495e2f1a 编写于 作者: N niuyazhe

refactor(nyz): add new compatibility file in ding top level

上级 7acdb671
import os
import torch
__TITLE__ = 'DI-engine'
__VERSION__ = 'v0.2.0'
......@@ -11,7 +10,3 @@ __version__ = __VERSION__
enable_hpc_rl = False
enable_linklink = os.environ.get('ENABLE_LINKLINK', 'false').lower() == 'true'
enable_numba = True
def torch_gt_131():
return int("".join(list(filter(str.isdigit, torch.__version__)))) >= 131
import torch
def torch_gt_131():
return int("".join(list(filter(str.isdigit, torch.__version__)))) >= 131
......@@ -4,7 +4,7 @@ import torch.nn as nn
import torch.nn.functional as F
from torch.nn.init import xavier_normal_, kaiming_normal_, orthogonal_
from typing import Union, Tuple, List, Callable
from ding import torch_gt_131
from ding.compatibility import torch_gt_131
from .normalization import build_normalization
......
......@@ -5,7 +5,7 @@ import torch
import re
from torch._six import string_classes
import collections.abc as container_abcs
from ding import torch_gt_131
from ding.compatibility import torch_gt_131
int_classes = int
np_str_obj_array_pattern = re.compile(r'[SaUO]')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册