Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blacklist custom ops while traversing graph. #132

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions morph_net/framework/op_handler_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ def get_input_ops(op, op_reg_manager, whitelist_indices=None):
Returns:
List of tf.Operation that are the inputs to op.
"""
if 'GumbelPrefix' in op.type:
return []
# Ignore scalar or 1-D constant inputs.
def is_const(tensor):
return tensor.op.type == 'Const'
Expand Down
5 changes: 5 additions & 0 deletions morph_net/tools/configurable_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ def __init__(self,
self._default_to_zero = fallback_rule == FallbackRule.zero
self._strict = fallback_rule == FallbackRule.strict

@property
def parameterization(self):
"""Returns the parameterization dict mapping op names to num_outputs."""
return self._parameterization

@tf.contrib.framework.add_arg_scope
def conv2d(self, *args, **kwargs):
"""Masks num_outputs from the function pointed to by 'conv2d'.
Expand Down