Browse Source

feat(mge/experimental): add WeightScaler support

GitOrigin-RevId: a1d5b68498
release-1.5
Megvii Engine Team huangxinda 4 years ago
parent
commit
75eb04c559
3 changed files with 31 additions and 2 deletions
  1. +8
    -0
      imperative/python/megengine/experimental/__init__.py
  2. +1
    -2
      imperative/python/megengine/functional/nn.py
  3. +22
    -0
      imperative/python/scripts/format.sh

+ 8
- 0
imperative/python/megengine/experimental/__init__.py View File

@@ -0,0 +1,8 @@
# -*- coding: utf-8 -*-
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ 1
- 2
imperative/python/megengine/functional/nn.py View File

@@ -1462,6 +1462,5 @@ warp_affine = deprecated_func("1.3", "megengine.functional.vision", "warp_affine
warp_perspective = deprecated_func( warp_perspective = deprecated_func(
"1.3", "megengine.functional.vision", "warp_perspective", True "1.3", "megengine.functional.vision", "warp_perspective", True
) )

from .loss import * # isort:skip
from .quantized import conv_bias_activation # isort:skip from .quantized import conv_bias_activation # isort:skip
from .loss import * # isort:skip

+ 22
- 0
imperative/python/scripts/format.sh View File

@@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -e
cd $(dirname $0)/..

ISORT_ARG=""
BLACK_ARG=""

while getopts 'd' OPT; do
case $OPT in
d)
ISORT_ARG="--diff --check-only"
BLACK_ARG="--diff --check"
;;
?)
echo "Usage: `basename $0` [-d]"
esac
done

# do not isort megengine/__init__.py file, caused we must
# init library load path before load dependent lib in core
isort $ISORT_ARG -j $(nproc) -rc megengine test examples -s megengine/__init__.py
black $BLACK_ARG --target-version=py35 -- megengine test examples

Loading…
Cancel
Save