Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, layer, type_str, layer_name=None):
if layer_name is None:
super(CaffeGraphNode,
self).__init__(layer,
layer.name.replace('/', '_').replace('-', '_'))
else:
super(CaffeGraphNode,
self).__init__(layer,
layer_name.replace('/', '_').replace('-', '_'))
self.layer_type = type_str
self.fluid_code = FluidCode()
self.data = None
def __init__(self, layer, layer_name=None):
if layer_name is None:
super(ONNXGraphNode, self).__init__(layer, layer.name)
else:
super(ONNXGraphNode, self).__init__(layer, layer_name)
self.layer_type = layer.op_type
self.fluid_code = FluidCode()
self.attr_map = self.get_attr_map()
self.out_shapes = list()
self.dtype = None
self.which_child = {}
def __init__(self, layer, layer_name=None, data_format="NHWC"):
if layer_name is None:
super(TFGraphNode, self).__init__(
layer,
layer.name.replace('/', '_').replace('-', '_').replace('^', ''))
else:
super(TFGraphNode, self).__init__(
layer,
layer_name.replace('/', '_').replace('-', '_').replace('^', ''))
self.layer_type = layer.op
self.tf_data_format = data_format
self.pd_data_format = "NCHW"
self.fluid_code = FluidCode()
self.dtype_map = {
1: "float32",
3: "int32",
4: "uint8",
9: "int64",
10: "bool"
}