def _convert_expand_dims(self, node):
input_names = self._get_input_tensors(node)
g = self._get_current_graph()
if len(input_names) == 2 and g[node.inputs[1]].attr["value"].val is None:
raise NotImplementedError("[SSAConverter] Cannot handle dynamic expandDims")
axes = g[node.inputs[1]].attr["value"].val
layer = self._get_builder().add_expand_dims(
name=node.name, input_name=input_names[0], output_name=node.name, axes=axes)
shapes.propagate_single_layer(layer, self.tensor_shapes)
After Change
shapes.propagate_single_layer(layer, self.tensor_shapes)
def _convert_expand_dims(self, node):
input_nodes, input_names, input_types = self._get_input_tensors(node)
if _is_scalar(input_types[0]): // skip/identity op in that case
self.op_tensor_map[node.name] = [input_names[0]]
if len(input_names) == 2 and input_nodes[1].value.val is None:
raise NotImplementedError("[SSAConverter] Cannot handle dynamic expandDims")
axes = input_nodes[1].value.val