Ejemplo n.º 1
0
 def extract(cls, node):
     # some Dropout flavors doesn't have is_test attribute; when it is missing, interpret it as 1
     is_test = onnx_attr(node, 'is_test', 'i', 1)
     if len(node.out_nodes()) > 1:
         raise Error(
             'Dropout node {} has more than one consumer. Unsupported.',
             node.name)
     if not is_test:
         raise Error(
             'Dropout node {} has is_test: 0. This means training mode which is not supported.',
             node.name)
     Identity.update_node_stat(node)
     return cls.enabled
Ejemplo n.º 2
0
    def extract(cls, node):
        pb = node.parameters

        collect_until_token(pb, b'<Dim>')
        dim = read_binary_integer32_token(pb)

        collect_until_token(pb, b'<BlockDim>')
        block_dim = read_binary_integer32_token(pb)

        collect_until_token(pb, b'<TimePeriod>')
        time_period = read_binary_integer32_token(pb)

        collect_until_token(pb, b'<DropoutProportion>')
        dropout_proporion = read_binary_float_token(pb)

        # collect_until_token(pb, b'<Continuous>')
        Identity.update_node_stat(node, {})

        return cls.enabled
Ejemplo n.º 3
0
 def extract(cls, node: Node):
     Identity.update_node_stat(node, {})
     return cls.enabled
Ejemplo n.º 4
0
 def extract(cls, node: Node):
     Identity.update_node_stat(node, {'op': 'StopGradient'})
     return cls.enabled
Ejemplo n.º 5
0
 def extract(cls, node: Node):
     Identity.update_node_stat(node, {
         'data_type': tf_dtype_extractor(node.pb.attr["T"].type),
     })
     return cls.enabled