Skip to content

Commit

Permalink
isort all files
Browse files Browse the repository at this point in the history
  • Loading branch information
SigureMo committed Nov 28, 2022
1 parent ea830d4 commit c86b316
Show file tree
Hide file tree
Showing 686 changed files with 2,570 additions and 1,666 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import sys
import unittest

import numpy as np

import paddle
Expand All @@ -22,8 +23,8 @@
sys.path.append("..")
import auto_parallel_gpt_model as modeling
from auto_parallel_gpt_model import (
GPTModel,
GPTForPretraining,
GPTModel,
GPTPretrainingCriterion,
)

Expand Down Expand Up @@ -111,13 +112,13 @@ def test_gpt(self):
sequence_len,
vocab_size,
)
from paddle.distributed.auto_parallel.dist_context import (
DistributedContext,
)
from paddle.distributed.auto_parallel.tuner.rule_based_tuner import (
_PATTERNS,
RuleBasedTuner,
convert_to_graph,
_PATTERNS,
)
from paddle.distributed.auto_parallel.dist_context import (
DistributedContext,
)

dist_context = DistributedContext()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from transformer_dygraph_model import MultiHeadAttention, PrePostProcessLayer

import paddle
import paddle.fluid as fluid
from paddle.fluid.dygraph import Embedding, Layer, Linear
from paddle.jit.api import declarative

from transformer_dygraph_model import MultiHeadAttention, PrePostProcessLayer


class PositionwiseFeedForwardLayer(Layer):
def __init__(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@

import paddle
import paddle.fluid as fluid
from paddle.fluid.dygraph.nn import BatchNorm
from paddle.fluid.param_attr import ParamAttr
from paddle.fluid.regularizer import L2Decay

from paddle.fluid.dygraph.nn import BatchNorm


class ConvBNLayer(fluid.dygraph.Layer):
def __init__(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import paddle

from functools import wraps

import paddle


def deco1(fun):
@wraps(fun)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@
import os

import numpy as np
import paddle.fluid as fluid

from paddle.fluid.core import AnalysisConfig
from paddle.fluid.core import create_paddle_predictor
import paddle.fluid as fluid
from paddle.fluid.core import AnalysisConfig, create_paddle_predictor


class PredictorTools:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
# limitations under the License.

import numpy as np
from seq2seq_utils import Seq2SeqModelHyperParams as args

import paddle
import paddle.fluid as fluid
from paddle.fluid import ParamAttr
from paddle.fluid import layers
from paddle.fluid import ParamAttr, layers
from paddle.fluid.dygraph import Layer
from paddle.fluid.dygraph.base import to_variable
from paddle.jit.api import declarative
from paddle.fluid.dygraph.nn import Embedding
from seq2seq_utils import Seq2SeqModelHyperParams as args
from paddle.jit.api import declarative

INF = 1.0 * 1e5
alpha = 0.6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from functools import reduce

import paddle
import paddle.fluid as fluid
import paddle.fluid.param_attr as attr

from functools import reduce
from paddle.jit.api import declarative
from paddle.fluid.dygraph import Embedding, Layer, Linear
from paddle.jit.api import declarative
from paddle.static import Variable


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

from functools import reduce

import paddle
from paddle.static import Variable

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import numpy
import unittest

import numpy

import paddle
import paddle.fluid as fluid
from paddle.jit import ProgramTranslator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,22 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import unittest
import textwrap
from paddle.utils import gast
import inspect
import numpy as np
import paddle
import paddle.fluid as fluid
from paddle.fluid.dygraph.dygraph_to_static.utils import ast_to_func
import textwrap
import unittest

import numpy as np
from ifelse_simple_func import (
dyfunc_with_if_else,
dyfunc_with_if_else2,
nested_if_else,
)

import paddle
import paddle.fluid as fluid
from paddle.fluid.dygraph.dygraph_to_static.utils import ast_to_func
from paddle.utils import gast


class TestAST2Func(unittest.TestCase):
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import numpy as np
import unittest
import inspect
from paddle.utils import gast
import unittest

import numpy as np

import paddle
import paddle.fluid as fluid
import paddle.fluid.dygraph as dygraph

from paddle import to_tensor
from paddle.fluid.dygraph import to_variable
from paddle.jit.api import dygraph_to_static_func
from paddle.fluid.dygraph.dygraph_to_static.utils import is_dygraph_api
from paddle.jit.api import dygraph_to_static_func
from paddle.utils import gast

SEED = 2020
np.random.seed(SEED)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,19 @@
# limitations under the License.

import os
import time
import tempfile
import time
import unittest

import numpy as np
from bert_dygraph_model import PretrainModelLayer
from bert_utils import get_bert_config, get_feed_data_reader
from predictor_utils import PredictorTools

import paddle
import paddle.fluid as fluid
from paddle.jit import ProgramTranslator
from paddle.fluid.dygraph.io import INFER_MODEL_SUFFIX, INFER_PARAMS_SUFFIX

from bert_dygraph_model import PretrainModelLayer
from bert_utils import get_bert_config, get_feed_data_reader

from predictor_utils import PredictorTools
from paddle.jit import ProgramTranslator

program_translator = ProgramTranslator()
place = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import os
import math
import numpy as np
import os
import tempfile
import unittest

import numpy as np
from predictor_utils import PredictorTools

import paddle
import tempfile
from paddle.jit import to_static
import paddle.fluid as fluid
from paddle.fluid import ParamAttr
from paddle.fluid.dygraph import to_variable
from paddle.jit import ProgramTranslator
from paddle.fluid.dygraph.io import INFER_MODEL_SUFFIX, INFER_PARAMS_SUFFIX

from predictor_utils import PredictorTools
from paddle.jit import ProgramTranslator, to_static

SEED = 2000
DATATYPE = 'float32'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
# limitations under the License.

import unittest

import numpy as np

import paddle
import paddle.fluid as fluid
from paddle.jit.api import declarative
from paddle.jit.dy2static.program_translator import (
ProgramTranslator,
)
from paddle.fluid.dygraph.dygraph_to_static.utils import Dygraph2StaticException
from paddle.jit.api import declarative
from paddle.jit.dy2static.program_translator import ProgramTranslator

SEED = 2020
np.random.seed(SEED)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import paddle
import unittest
import numpy as np
from paddle.jit import ProgramTranslator

import numpy as np
from test_resnet import ResNetHelper

import paddle
from paddle.jit import ProgramTranslator

program_translator = ProgramTranslator()


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@
# limitations under the License.

import unittest
import numpy as np
from collections import Counter

import numpy as np
from test_fetch_feed import Linear, Pool2D

import paddle
import paddle.fluid as fluid

from paddle.jit.api import declarative
from paddle.jit import ProgramTranslator
from paddle.jit.api import declarative
from paddle.jit.dy2static import convert_to_static

from test_fetch_feed import Pool2D, Linear


class TestCacheProgram(unittest.TestCase):
def setUp(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
# limitations under the License.

import unittest

import numpy as np

import paddle.fluid as fluid
from paddle.jit.api import declarative

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import inspect
import unittest

from numpy import append

import paddle
from paddle.fluid.dygraph.dygraph_to_static.utils import (
FunctionNameLivenessAnalysis,
)
from paddle.utils import gast
import inspect
from numpy import append

global_a = []

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
# limitations under the License.

import os
import paddle
import tempfile
import unittest

import numpy as np
import tempfile

import paddle


class BufferLayers(paddle.nn.Layer):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import logging
import unittest

import logging
import numpy as np
from test_program_translator import get_source_code

import paddle
import paddle.fluid as fluid
from paddle.jit import ProgramTranslator
import paddle.jit.dy2static as _jst
from paddle.fluid.dygraph.dygraph_to_static.convert_call_func import (
CONVERSION_OPTIONS,
)
from test_program_translator import get_source_code
import paddle.jit.dy2static as _jst
from paddle.jit import ProgramTranslator

program_translator = ProgramTranslator()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import unittest

import numpy as np

import paddle
import unittest


class CallNotExist(paddle.nn.Layer):
Expand Down
Loading

0 comments on commit c86b316

Please sign in to comment.