docstr: Layers in hls_model.py can specify output array partitioning through the `pragma` attribute.
  If `pragma` is a string: options are 'partition', 'reshape', or 'stream'.
  If `pragma` is a tuple: (mode, type, factor) where mode is 'partition' or 'reshape', type is
  'complete', 'cyclic', or 'block', and factor is an integer only used when the type is not 'complete'.
docstr_tok: ["Layers","in","hls_model.py","can","specify","output","array","partitioning","through","the","`","pragma","`","attribute",".","If","`","pragma","`","is","a","string",":","options","are","'partition","'",",","'reshape","'",",","or","'stream","'",".","If","`","pragma","`","is","a","tuple",":","(","mode",",","type",",","factor",")","where","mode","is","'partition","'","or","'reshape","'",",","type","is","'complete","'",",","'cyclic","'",",","or","'block","'",",","and","factor","is","an","integer","only","used","when","the","type","is","not","'complete","'","."]
code: def _make_array_pragma(variable):
      """
      Layers in hls_model.py can specify output array partitioning through the `pragma` attribute.
      If `pragma` is a string: options are 'partition', 'reshape', or 'stream'.
      If `pragma` is a tuple: (mode, type, factor) where mode is 'partition' or 'reshape', type is
      'complete', 'cyclic', or 'block', and factor is an integer only used when the type is not 'complete'.
      """
  
      config = variable.pragma
      if type(config) is tuple:
          mode = config[0]
          if mode in ["partition", "reshape"]:
              typ = config[1]
              if typ != "complete":
                  factor = config[2]
          elif mode == "stream":
              depth = config[1]
      else:
          mode = config
          typ = "complete"
          factor = 0
  
      if mode in ["partition", "reshape"]:
          if typ == "complete":
              template = "#pragma HLS ARRAY_{mode} variable={name} {type} dim={dim}"
          else:
              template = "#pragma HLS ARRAY_{mode} variable={name} {type} factor={factor} dim={dim}"
  
          return template.format(
              mode=mode.upper(),
              name=variable.name,
              type=typ,
              factor=factor,
              dim=0,
          )
  
      elif mode == "stream":
          return f"#pragma HLS STREAM variable={variable.name} depth={depth}"
  
imports: import glob
  import os
  import tarfile
  from collections import OrderedDict
  from shutil import copyfile, copytree, rmtree
  import numpy
  import yaml
  from hls4ml.writer.writers import Writer
label_desc: Use image node_id 3 for calling the VivadoWriter obj's underlying member method code with example usage: obj._make_array_pragma(variable) and returns: template, str, variable, str, depth