code: def parse_flatten_layer(
      operation,
      layer_name,
      input_names,
      input_shapes,
      node,
      class_object,
      data_reader,
      config,
  ):
      assert operation == "Flatten"
  
      layer = {}
      layer["class_name"] = "Reshape"
      layer["name"] = layer_name
      layer["inputs"] = input_names
  
      start_dim = class_object.start_dim
      end_dim = class_object.end_dim
      if end_dim + 1 == 0 or end_dim + 1 > len(input_shapes[0]):
          end_dim = len(input_shapes[0])
      else:
          end_dim = end_dim + 1
  
      layer["target_shape"] = (
          input_shapes[0][0:start_dim]
          + [np.prod(input_shapes[0][start_dim:end_dim])]
          + input_shapes[0][end_dim:]
      )
      output_shape = layer["target_shape"]
  
      return layer, output_shape
  
imports: import numpy
  from hls4ml.converters.pytorch_to_hls import pytorch_handler
label_desc: Use image node_id 4 for calling a global function with example usage: parse_flatten_layer(operation, layer_name, input_names, input_shapes, node, class_object, data_reader, config) and returns: layer,  output_shape