Skip to content
Snippets Groups Projects
Commit c2052b2b authored by Neta Zmora's avatar Neta Zmora
Browse files

summary_graph.py: fix issue #360

Add try/except block around code accessing missing convolution
shape information.
parent 31c1bd89
No related branches found
No related tags found
No related merge requests found
...@@ -325,8 +325,15 @@ class SummaryGraph(object): ...@@ -325,8 +325,15 @@ class SummaryGraph(object):
elif op['type'] == 'Gemm': elif op['type'] == 'Gemm':
conv_out = op['outputs'][0] conv_out = op['outputs'][0]
conv_in = op['inputs'][0] conv_in = op['inputs'][0]
n_ifm = self.param_shape(conv_in)[1] try:
n_ofm = self.param_shape(conv_out)[1] n_ifm = self.param_shape(conv_in)[1]
n_ofm = self.param_shape(conv_out)[1]
msglogger.error("An input to a Convolutional layer is missing shape information.")
msglogger.error("For details see https://github.com/NervanaSystems/distiller/issues/360")
except IndexError:
n_ifm = 0
n_ofm = 0
# MACs = #IFM * #OFM # MACs = #IFM * #OFM
op['attrs']['MACs'] = n_ofm * n_ifm op['attrs']['MACs'] = n_ofm * n_ifm
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment