Skip to content

Commit

Permalink
Add distill dirs (PaddlePaddle#787)
Browse files Browse the repository at this point in the history
* add distill dirs

* fix unittest
  • Loading branch information
ceci3 committed Jun 7, 2021
1 parent 1492712 commit 6947a1e
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 2 deletions.
2 changes: 2 additions & 0 deletions paddleslim/dygraph/__init__.py
Expand Up @@ -3,3 +3,5 @@
__all__ += quant.__all__
from .prune import *
__all__ += prune.__all__
from .dist import *
__all__ += dist.__all__
15 changes: 15 additions & 0 deletions paddleslim/dygraph/dist/__init__.py
@@ -0,0 +1,15 @@
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# 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.

__all__ = []
13 changes: 13 additions & 0 deletions paddleslim/dygraph/dist/adaptors/__init__.py
@@ -0,0 +1,13 @@
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# 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.
13 changes: 13 additions & 0 deletions paddleslim/dygraph/dist/configs/__init__.py
@@ -0,0 +1,13 @@
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# 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.
13 changes: 13 additions & 0 deletions paddleslim/dygraph/dist/losses/__init__.py
@@ -0,0 +1,13 @@
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# 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.
6 changes: 4 additions & 2 deletions tests/test_soft_label_loss.py
Expand Up @@ -56,8 +56,10 @@ def test_soft_label_loss(self):
loss_ops.append(op.type)
self.assertTrue(set(merged_ops).difference(set(loss_ops)) == set())
self.assertTrue(
set(loss_ops).difference(set(merged_ops)) ==
{'cross_entropy', 'softmax', 'reduce_mean', 'scale'})
set(loss_ops).difference(set(merged_ops)) == {
'cross_entropy', 'softmax', 'reduce_mean', 'fill_constant',
'elementwise_div'
})


if __name__ == '__main__':
Expand Down

0 comments on commit 6947a1e

Please sign in to comment.