diff --git a/Classification/cnns/alexnet_model.py b/Classification/cnns/alexnet_model.py index 097ba1c3932d58a51bfb99eedb1270ed11816b20..d627fc0e504b7a7893ca30a36bafee86ea527521 100644 --- a/Classification/cnns/alexnet_model.py +++ b/Classification/cnns/alexnet_model.py @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. """ -import oneflow as flow +import oneflow.compatible.single_client as flow def _get_kernel_initializer(data_format="NCHW"): diff --git a/Classification/cnns/inception_model.py b/Classification/cnns/inception_model.py index 2bcf0f76f6841c656132ad4c8594bd078a670f7d..3a0ec6ced93caf388bba043aa5568a7ca4f96db9 100644 --- a/Classification/cnns/inception_model.py +++ b/Classification/cnns/inception_model.py @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. """ -import oneflow as flow +import oneflow.compatible.single_client as flow def _get_kernel_initializer(): diff --git a/Classification/cnns/job_function_util.py b/Classification/cnns/job_function_util.py index 88675c07ab1bb2d323fc166cd7451f92b0142882..c651e95f2de70f620f30a4c8b852e9b9c45e4e9d 100755 --- a/Classification/cnns/job_function_util.py +++ b/Classification/cnns/job_function_util.py @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. """ -import oneflow as flow +import oneflow.compatible.single_client as flow def _default_config(args): diff --git a/Classification/cnns/mobilenet_v2_model.py b/Classification/cnns/mobilenet_v2_model.py index 31eeb8d34cd41cc3bc012461e6e34058862a2d60..de41bc44938be391e7c0f0d8bd50f813916d97a2 100644 --- a/Classification/cnns/mobilenet_v2_model.py +++ b/Classification/cnns/mobilenet_v2_model.py @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. """ -import oneflow as flow +import oneflow.compatible.single_client as flow # ref : https://arxiv.org/pdf/1801.04381.pdf # ref : https://github.com/liangfu/mxnet-mobilenet-v2/blob/master/symbols/mobilenetv2.py diff --git a/Classification/cnns/of_cnn_evaluate.py b/Classification/cnns/of_cnn_evaluate.py index 59725d01a51601754663555ca961d901d09e5783..998638c9e57f8ca6c5a5d094054528bfaa0a1497 100644 --- a/Classification/cnns/of_cnn_evaluate.py +++ b/Classification/cnns/of_cnn_evaluate.py @@ -28,7 +28,7 @@ configs.print_args(args) from util import Snapshot, InitNodes, Metric import ofrecord_util from job_function_util import get_train_config, get_val_config -import oneflow as flow +import oneflow.compatible.single_client as flow import vgg_model import resnet_model import resnext_model diff --git a/Classification/cnns/of_cnn_inference.py b/Classification/cnns/of_cnn_inference.py index 668c0fe5f38c133b501fc0fe5aa8b77b327e27e8..cd43d8deaf050f4f3e3568908d95d0841ba66ec0 100755 --- a/Classification/cnns/of_cnn_inference.py +++ b/Classification/cnns/of_cnn_inference.py @@ -24,8 +24,8 @@ parser = configs.get_parser() args = parser.parse_args() configs.print_args(args) -import oneflow as flow -import oneflow.typing as tp +import oneflow.compatible.single_client as flow +import oneflow.compatible.single_client.typing as tp from imagenet1000_clsidx_to_labels import clsidx_2_labels import resnet_model diff --git a/Classification/cnns/of_cnn_train_val.py b/Classification/cnns/of_cnn_train_val.py index ff9f4c3a4eb9c0f17bc7b0aa0c0ecdf4ead39a0b..1c995bfd52fce62d7ba75a644453f17566732930 100755 --- a/Classification/cnns/of_cnn_train_val.py +++ b/Classification/cnns/of_cnn_train_val.py @@ -15,7 +15,7 @@ limitations under the License. """ import os import math -import oneflow as flow +import oneflow.compatible.single_client as flow import ofrecord_util import optimizer_util import config as configs diff --git a/Classification/cnns/ofrecord_util.py b/Classification/cnns/ofrecord_util.py index 962c866e01298edee6d709839a0d41db72320c10..c6cca07ac7e0d6fc2a5d278c1af68907c235fe26 100755 --- a/Classification/cnns/ofrecord_util.py +++ b/Classification/cnns/ofrecord_util.py @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. """ -import oneflow as flow +import oneflow.compatible.single_client as flow def add_ofrecord_args(parser): diff --git a/Classification/cnns/optimizer_util.py b/Classification/cnns/optimizer_util.py index 7880d9ab53ec9e24d8e1347dce40eaab238bbd15..43cd977d6b329c4662abf435d43b4d33ee5b73e4 100755 --- a/Classification/cnns/optimizer_util.py +++ b/Classification/cnns/optimizer_util.py @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -import oneflow as flow +import oneflow.compatible.single_client as flow import math import pprint diff --git a/Classification/cnns/resnet_model.py b/Classification/cnns/resnet_model.py index ffb03db11720ff744d2fc5b76a172bf7436a57ef..7e9c1fc4c8017edc922340a2e6b32f2322b1b8cc 100755 --- a/Classification/cnns/resnet_model.py +++ b/Classification/cnns/resnet_model.py @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. """ -import oneflow as flow +import oneflow.compatible.single_client as flow BLOCK_COUNTS = [3, 4, 6, 3] BLOCK_FILTERS = [256, 512, 1024, 2048] diff --git a/Classification/cnns/resnet_to_onnx.py b/Classification/cnns/resnet_to_onnx.py index a0a0fb84b5d6b82b260aea4048cf8fefc4c9820d..b8bd515c424e9c4c76bd1b9428772760ce94c4e0 100644 --- a/Classification/cnns/resnet_to_onnx.py +++ b/Classification/cnns/resnet_to_onnx.py @@ -18,8 +18,8 @@ import time from typing import Callable, Text import numpy as np -import oneflow as flow -import oneflow.typing as tp +import oneflow.compatible.single_client as flow +import oneflow.compatible.single_client.typing as tp import onnx import onnxruntime as ort diff --git a/Classification/cnns/resnext_model.py b/Classification/cnns/resnext_model.py index afdfe7672f7e32740c8d2c4b7b15cc8f2033f5de..2d0cd55c71b7103f89ed310e6673c019a4c04f11 100755 --- a/Classification/cnns/resnext_model.py +++ b/Classification/cnns/resnext_model.py @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. """ -import oneflow as flow +import oneflow.compatible.single_client as flow import collections diff --git a/Classification/cnns/util.py b/Classification/cnns/util.py index b66f485b383fd7bc46a237b092799873f9ee93ee..1c86d32f4293d0d4437ead7520489d197da28ec8 100755 --- a/Classification/cnns/util.py +++ b/Classification/cnns/util.py @@ -19,7 +19,7 @@ import time import numpy as np import pandas as pd from datetime import datetime -import oneflow as flow +import oneflow.compatible.single_client as flow def InitNodes(args): diff --git a/Classification/cnns/vgg_model.py b/Classification/cnns/vgg_model.py index 47f69f23727bf4dbda1e810b3472175c90278485..c40189bf6be0251217bed78963f2db3853a49f6d 100644 --- a/Classification/cnns/vgg_model.py +++ b/Classification/cnns/vgg_model.py @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. """ -import oneflow as flow +import oneflow.compatible.single_client as flow def _batch_norm(inputs, name=None, trainable=True, training=True, data_format="NCHW"): diff --git a/ClickThroughRate/WideDeepLearning/wdl_train_eval.py b/ClickThroughRate/WideDeepLearning/wdl_train_eval.py index 726fb69b2607f49e4858b38a3060bdfb4952e97d..964b3ba88b2c3b8051b6edd31a40fcda84b5ee49 100644 --- a/ClickThroughRate/WideDeepLearning/wdl_train_eval.py +++ b/ClickThroughRate/WideDeepLearning/wdl_train_eval.py @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. """ import argparse -import oneflow as flow +import oneflow.compatible.single_client as flow import datetime import os import glob diff --git a/ClickThroughRate/WideDeepLearning/wdl_train_eval_test.py b/ClickThroughRate/WideDeepLearning/wdl_train_eval_test.py index 7b0e63eb659f3d9f08e99b61e44c459082fbeaf6..0dc05021d0c75f6c089748f418b88318108992e5 100644 --- a/ClickThroughRate/WideDeepLearning/wdl_train_eval_test.py +++ b/ClickThroughRate/WideDeepLearning/wdl_train_eval_test.py @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. """ import argparse -import oneflow as flow +import oneflow.compatible.single_client as flow import datetime import os import glob diff --git a/ClickThroughRate/WideDeepLearning/wdl_train_eval_with_hybrid_embd.py b/ClickThroughRate/WideDeepLearning/wdl_train_eval_with_hybrid_embd.py index b7790c0ffc0082cf8d43d152457cead77297008d..e22ec2438c119cff1b4f5699165d207aad95050c 100644 --- a/ClickThroughRate/WideDeepLearning/wdl_train_eval_with_hybrid_embd.py +++ b/ClickThroughRate/WideDeepLearning/wdl_train_eval_with_hybrid_embd.py @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. """ import argparse -import oneflow as flow +import oneflow.compatible.single_client as flow import datetime import os import glob diff --git a/Generative/dcgan.py b/Generative/dcgan.py index 3c35097d5bb91862459b25b0d8f838e34345cf53..8f24a32302fec771d44cd497271a49b7b9c92fd1 100644 --- a/Generative/dcgan.py +++ b/Generative/dcgan.py @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -import oneflow as flow +import oneflow.compatible.single_client as flow import numpy as np import imageio import glob diff --git a/Generative/layers.py b/Generative/layers.py index 0417ee9196b062cf8d1e6f1547fe4831dc13849c..225fcbc272a264d60df829562ac5b8b0e3392058 100644 --- a/Generative/layers.py +++ b/Generative/layers.py @@ -13,8 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -import oneflow as flow -import oneflow.python.framework.distribute as distribute_util +import oneflow.compatible.single_client as flow def get_const_initializer(): return flow.constant_initializer(0.002) diff --git a/LanguageModeling/BERT/bert.py b/LanguageModeling/BERT/bert.py index 00e3ed1952e314cb38b99a1003d9e13951e66206..b652f6523a781c1e5fa5db12b1d36127fcabae2f 100755 --- a/LanguageModeling/BERT/bert.py +++ b/LanguageModeling/BERT/bert.py @@ -13,8 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -import oneflow as flow -import oneflow.core.common.data_type_pb2 as data_type_util +import oneflow.compatible.single_client as flow import oneflow.core.operator.op_conf_pb2 as op_conf_util import math diff --git a/LanguageModeling/BERT/classifier.py b/LanguageModeling/BERT/classifier.py index 0d3ab971a66c004280a6f3c4f04b438fee454255..ac68168ed5770b239bdd7ccd4f630077659a5c07 100644 --- a/LanguageModeling/BERT/classifier.py +++ b/LanguageModeling/BERT/classifier.py @@ -13,9 +13,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -import oneflow as flow +import oneflow.compatible.single_client as flow import bert as bert_util -import oneflow.core.operator.op_conf_pb2 as op_conf_util def GlueBERT( diff --git a/LanguageModeling/BERT/pretrain.py b/LanguageModeling/BERT/pretrain.py index bc983e87acd81b4446d8cbde06514d6ad31e7ab3..ab94c867d1bf7eb836bce018f34cf9e4290f54e0 100755 --- a/LanguageModeling/BERT/pretrain.py +++ b/LanguageModeling/BERT/pretrain.py @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -import oneflow as flow +import oneflow.compatible.single_client as flow import bert as bert_util import oneflow.core.operator.op_conf_pb2 as op_conf_util diff --git a/LanguageModeling/BERT/run_classifier.py b/LanguageModeling/BERT/run_classifier.py index dc5223f4e5853ee4e912bc93cf8d718dd3b60478..f8b7f9337a2f85bfcfaf499bfdc95476dd8a90ab 100644 --- a/LanguageModeling/BERT/run_classifier.py +++ b/LanguageModeling/BERT/run_classifier.py @@ -18,7 +18,7 @@ import os import math import numpy as np -import oneflow as flow +import oneflow.compatible.single_client as flow from classifier import GlueBERT from util import Snapshot, InitNodes, Metric, CreateOptimizer, GetFunctionConfig diff --git a/LanguageModeling/BERT/run_pretraining.py b/LanguageModeling/BERT/run_pretraining.py index 0b04de64303752ec1b0091bfda9f3169c0730b72..01b4fa55ab3eb45566c3c2d8e17361f1547aae23 100755 --- a/LanguageModeling/BERT/run_pretraining.py +++ b/LanguageModeling/BERT/run_pretraining.py @@ -19,7 +19,7 @@ import argparse from datetime import datetime import config as configs -import oneflow as flow +import oneflow.compatible.single_client as flow from pretrain import PreTrain from util import Snapshot, InitNodes, Metric, CreateOptimizer, GetFunctionConfig diff --git a/LanguageModeling/BERT/run_squad.py b/LanguageModeling/BERT/run_squad.py index a0d104d42a2ab8fdf49cee8f5a0d090b6e6ead38..dcc172e78f5273c57d9ff226309ce985517037e9 100755 --- a/LanguageModeling/BERT/run_squad.py +++ b/LanguageModeling/BERT/run_squad.py @@ -21,7 +21,7 @@ from datetime import datetime import config as configs from config import str2bool -import oneflow as flow +import oneflow.compatible.single_client as flow from squad import SQuAD from util import Snapshot, InitNodes, Metric, CreateOptimizer, GetFunctionConfig diff --git a/LanguageModeling/BERT/squad.py b/LanguageModeling/BERT/squad.py index 05ab4593b5ee4b86697e60533ec0c4d1f7ab9f5c..37e76ab34da0f851768290b1630b4289d609fda6 100755 --- a/LanguageModeling/BERT/squad.py +++ b/LanguageModeling/BERT/squad.py @@ -13,9 +13,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -import oneflow as flow +import oneflow.compatible.single_client as flow import bert as bert_util -import oneflow.core.operator.op_conf_pb2 as op_conf_util def SQuAD( diff --git a/LanguageModeling/BERT/util.py b/LanguageModeling/BERT/util.py index 3f288e0d8575fd743223ab7539edce53f7d123aa..f955749a24091c87b54d2da1862d899a1942b891 100755 --- a/LanguageModeling/BERT/util.py +++ b/LanguageModeling/BERT/util.py @@ -20,7 +20,7 @@ import numpy as np from collections import OrderedDict import pandas as pd from datetime import datetime -import oneflow as flow +import oneflow.compatible.single_client as flow def InitNodes(args): diff --git a/LanguageModeling/GPT/oneflow_gpt/data.py b/LanguageModeling/GPT/oneflow_gpt/data.py index e26101151f8f0d404ecc852d50cc9490f3bd70f8..5afb215d705d731c1ac47ce7759870a2f7ec2ee1 100644 --- a/LanguageModeling/GPT/oneflow_gpt/data.py +++ b/LanguageModeling/GPT/oneflow_gpt/data.py @@ -1,4 +1,4 @@ -import oneflow as flow +import oneflow.compatible.single_client as flow from oneflow_gpt import distribute from oneflow_gpt.config import get_args diff --git a/LanguageModeling/GPT/oneflow_gpt/distribute.py b/LanguageModeling/GPT/oneflow_gpt/distribute.py index fc59076c3def027e7c3a3b5f1e35682bfda2f3df..309583554ed003103cfa79f24af377205f56e585 100644 --- a/LanguageModeling/GPT/oneflow_gpt/distribute.py +++ b/LanguageModeling/GPT/oneflow_gpt/distribute.py @@ -1,5 +1,5 @@ import contextlib -import oneflow as flow +import oneflow.compatible.single_client as flow from oneflow_gpt.config import get_args diff --git a/LanguageModeling/GPT/oneflow_gpt/model.py b/LanguageModeling/GPT/oneflow_gpt/model.py index bf8262742dc8c26050afba6f7d6d2c3c20f6c32b..8c423fe1f4a205b63659f3cc15143cf9efbe034a 100644 --- a/LanguageModeling/GPT/oneflow_gpt/model.py +++ b/LanguageModeling/GPT/oneflow_gpt/model.py @@ -1,6 +1,6 @@ import math import numpy as np -import oneflow as flow +import oneflow.compatible.single_client as flow from oneflow_gpt import distribute from oneflow_gpt.config import get_args diff --git a/LanguageModeling/GPT/oneflow_gpt/optimizer.py b/LanguageModeling/GPT/oneflow_gpt/optimizer.py index a0de006d55a5ed0c8017d2aa50e546b214aaa7d1..a190821721a67104d92595e7c4409fc1e5885260 100644 --- a/LanguageModeling/GPT/oneflow_gpt/optimizer.py +++ b/LanguageModeling/GPT/oneflow_gpt/optimizer.py @@ -1,4 +1,4 @@ -import oneflow as flow +import oneflow.compatible.single_client as flow def get_lr_scheduler(args): diff --git a/LanguageModeling/GPT/oneflow_gpt/snapshot.py b/LanguageModeling/GPT/oneflow_gpt/snapshot.py index 31dbe97e89435b127b1b891c6d27c3bdaf80ea5d..17c778641191b2250ce96c79bcdabcb2fa649ead 100644 --- a/LanguageModeling/GPT/oneflow_gpt/snapshot.py +++ b/LanguageModeling/GPT/oneflow_gpt/snapshot.py @@ -2,7 +2,7 @@ import os import re import glob import operator -import oneflow as flow +import oneflow.compatible.single_client as flow class Snapshot(object): diff --git a/LanguageModeling/GPT/oneflow_gpt/training.py b/LanguageModeling/GPT/oneflow_gpt/training.py index e931be57428ad667430239096d0b4f84b1833617..261ce297c12199ed0843b08cccca829c262b3f51 100644 --- a/LanguageModeling/GPT/oneflow_gpt/training.py +++ b/LanguageModeling/GPT/oneflow_gpt/training.py @@ -6,7 +6,7 @@ sys.path.append( ) import numpy as np -import oneflow as flow +import oneflow.compatible.single_client as flow from oneflow_gpt.config import get_args from oneflow_gpt import distribute diff --git a/LanguageModeling/GPT/tasks/zeroshot_gpt/evaluate.py b/LanguageModeling/GPT/tasks/zeroshot_gpt/evaluate.py index c1c7c13ad8f8b3d5043d17d28d0663d33fb02ad8..7d6bc43e051c01293655e5e7a4d2d49d6e5a4bf5 100644 --- a/LanguageModeling/GPT/tasks/zeroshot_gpt/evaluate.py +++ b/LanguageModeling/GPT/tasks/zeroshot_gpt/evaluate.py @@ -10,7 +10,7 @@ from oneflow_gpt.model import GPTModel, ParallelSparseSoftmaxCrossEntropyLoss from oneflow_gpt import util from .datasets import build_dataset import numpy as np -import oneflow as flow +import oneflow.compatible.single_client as flow def _init_env(args):