Esempio n. 1
0
 def extract(cls, node):
     # the default value for the TF Softmax is -1
     axis = -1
     if 'axis' in node.pb.attr:
         axis = node.pb.attr['axis'].i
     Softmax.update_node_stat(node, {'axis': axis})
     return cls.enabled
 def extract(cls, node):
     attrs = {
         'op': __class__.op,
         'axis': node.module.dim,
     }
     Softmax.update_node_stat(node, attrs)
     return cls.enabled
Esempio n. 3
0
    def extract(node):
        axis = onnx_attr(node, 'axis', 'i', default=1)

        attrs = {'axis': axis}

        # update the attributes of the node
        Softmax.update_node_stat(node, attrs)
        return __class__.enabled
Esempio n. 4
0
    def extract(node):
        proto_layer = node.pb
        param = proto_layer.softmax_param

        attrs = {'axis': param.axis}

        # update the attributes of the node
        Softmax.update_node_stat(node, attrs)
        return __class__.enabled
    def extract(cls, node):
        attrs = get_mxnet_layer_attrs(node.symbol_dict)

        update_attrs = {
            'type': 'SoftMax',
            'axis': attrs.int("axis", -1),
            'temperature': attrs.float('temperature', 1.0)
        }

        # update the attributes of the node
        Softmax.update_node_stat(node, update_attrs)
        return cls.enabled
    def extract(cls, node):
        attr = get_mxnet_layer_attrs(node.symbol_dict)
        mode = attr.str("mode", "instance")

        if mode == "channel":
            axis = 1
        else:
            axis = -1

        update_attrs = {
            'axis': axis,
        }

        # update the attributes of the node
        Softmax.update_node_stat(node, update_attrs)
        return cls.enabled
Esempio n. 7
0
    def extract(node):
        attrs = get_mxnet_layer_attrs(node.symbol_dict)

        axis = 1
        preserve_shape = attrs.str('preserve_shape', 'False')
        multi_output = attrs.str('multi_output', 'False')

        if preserve_shape == 'True':
            axis = -1

        if multi_output == 'True':
            axis = 1

        update_attrs = {
            'axis': axis,
        }

        # update the attributes of the node
        Softmax.update_node_stat(node, update_attrs)
        return __class__.enabled
Esempio n. 8
0
 def extract(cls, node):
     Softmax.update_node_stat(node, {'infer': copy_shape_infer})
     return cls.enabled
Esempio n. 9
0
 def extract(cls, node):
     axis = onnx_attr(node, 'axis', 'i', default=1)
     Softmax.update_node_stat(node, {'axis': axis})
     return cls.enabled
Esempio n. 10
0
 def extract(node):
     Softmax.update_node_stat(node, {'infer': copy_shape_infer})
     return __class__.enabled