Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Error code for Speedup Module #4173

Merged
merged 5 commits into from
Sep 22, 2021
Merged

Conversation

zheng-ningxin
Copy link
Contributor

Add Error code for speedup module.

@zheng-ningxin zheng-ningxin reopened this Sep 11, 2021

class EmptyLayerError(SpeedupError):
def __init__(self):
super(EmptyLayerError, self).__init__("Pruning a Layer to empty is not legal")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this situation, should we suggest the user add this layer in exclude?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not exactly the same, there may be two reasons that a layer is pruned to empty: (1) it's sparsity ratio equals to 1.0 (2) it's output is useless after the mask propagation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it


class ShapeMisMatchError(SpeedupError):
def __init__(self):
super(ShapeMisMatchError, self).__init__("Shape mismatch!")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can also add layer name in the error message for debugging?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good suggestion, but I cannot get the op_name in the module replace functions under current interfaces. To keep the replacement function interface clean, I suggest to just report the error type now.

@QuanluZhang QuanluZhang merged commit 607d6a9 into microsoft:master Sep 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants