浏览代码

ban raw tensorflow imports

/develop-gpu-test
Chris Elion 5 年前
当前提交
6b54b0ca
共有 3 个文件被更改,包括 8 次插入1 次删除
  1. 1
      .pre-commit-config.yaml
  2. 4
      ml-agents/mlagents/trainers/tf.py
  3. 4
      setup.cfg

1
.pre-commit-config.yaml


.*_pb2.py|
.*_pb2_grpc.py
)$
additional_dependencies: [flake8-tidy-imports]
# "Local" hooks, see https://pre-commit.com/#repository-local-hooks
- repo: local
hooks:

4
ml-agents/mlagents/trainers/tf.py


import tensorflow as tf
# This should be the only place that we import tensorflow directly.
# Everywhere else is caught by the banned-modules setting for flake8
import tensorflow as tf # noqa I201
from distutils.version import LooseVersion

4
setup.cfg


# Black tends to introduce things flake8 doesn't like, such as "line break before binary operator"
# or whitespace before ':'. Rather than fight with black, just ignore these for now.
W503, E203,
# flake-tidy-import adds this warning, which we don't really care about for now
I200
banned-modules = tensorflow = use mlagents.tf instead (it handles tf2 compat).
正在加载...
取消
保存