Skip to content

Commit 12bf7d9

Browse files
ClarkChin08ftian1
authored andcommitted
add copyright and missed __init__.py file in lpot/adaptor/torch_utils
1 parent 5f4835e commit 12bf7d9

File tree

7 files changed

+44
-11
lines changed

7 files changed

+44
-11
lines changed

lpot/adaptor/torch_utils/__init__.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
#
4+
# Copyright (c) 2021 Intel Corporation
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+

lpot/adaptor/torch_utils/util.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
#
2+
# -*- coding: utf-8 -*-
3+
#
4+
# Copyright (c) 2021 Intel Corporation
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
118
import numpy as np
219
import torch
320

lpot/data/dataloaders/dataloader.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33
#
4-
# Copyright (c) 2020 Intel Corporation
4+
# Copyright (c) 2021 Intel Corporation
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717

18-
1918
from lpot.experimental.data.dataloaders import DATALOADERS
2019

2120
# THIS API IS TO BE DEPRECATED!

lpot/data/datasets/imagenet_dataset.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ class ONNXRTImagenetDataset(Dataset):
8888

8989
def __init__(self, root, subset='val', num_cores=28, transform=None, filter=None):
9090
self.val_dir = os.path.join(root, subset)
91-
assert os.path.exists(self.val_dir), "find no val dir in dataset path, please \
92-
makesure there are train/val subfolders"
91+
assert os.path.exists(self.val_dir), "find no val dir in {}".format(root) + \
92+
"please make sure there are train/val subfolders"
9393
import glob
94-
logger.warning('This api is going to be deprecated, '
94+
logger.warning('This api is going to be deprecated, ' + \
9595
'please use ImageRecord instead')
9696

9797
self.transform = transform

lpot/experimental/benchmark.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ def model(self, user_model):
169169
from .common import Model as LpotModel
170170
from ..model import MODELS
171171
if not isinstance(user_model, LpotModel):
172-
logger.warning('force convert user raw model to lpot model, \
173-
better initialize lpot.experimental.common.Model and set....')
172+
logger.warning('force convert user raw model to lpot model, ' +
173+
'better initialize lpot.experimental.common.Model and set....')
174174
user_model = LpotModel(user_model)
175175

176176
framework_model_info = {}

lpot/experimental/pruning.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ def model(self, user_model):
145145
"""
146146
from .common import Model as LpotModel
147147
if not isinstance(user_model, LpotModel):
148-
logger.warning('force convert user raw model to lpot model, \
149-
better initialize lpot.experimental.common.Model and set....')
148+
logger.warning('force convert user raw model to lpot model, ' +
149+
'better initialize lpot.experimental.common.Model and set....')
150150
user_model = LpotModel(user_model)
151151
framework_model_info = {}
152152
cfg = self.conf.usr_cfg

lpot/experimental/quantization.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,8 @@ def model(self, user_model):
253253
from .common import Model as LpotModel
254254
from ..model import MODELS
255255
if not isinstance(user_model, LpotModel):
256-
logger.warning('force convert user raw model to lpot model, \
257-
better initialize lpot.experimental.common.Model and set....')
256+
logger.warning('force convert user raw model to lpot model, ' +
257+
'better initialize lpot.experimental.common.Model and set....')
258258
user_model = LpotModel(user_model)
259259

260260
framework_model_info = {}

0 commit comments

Comments
 (0)