Skip to content

Adding the GarNet layer and an example project

Javier Duarte requested to merge github/fork/yiiyama/garnet into master

Created by: yiiyama

Original keras layer: https://github.com/jkiesele/caloGraphNN/blob/master/caloGraphNN_keras.py

Aside from GarNet-specific templates, converter codes, and hls_model.py classes, this PR introduces the following changes:

  • In hls_model.py, a new variable type name is introduced when Layer.add_weights_variable is called with a specified precision, even when the type_name argument is None. Otherwise repeated calls with precision not None but type_name None will keep using the default type name and overwriting the precision specified in the previous call.
  • In templates.py and vivado_template.py, added a method get_precision to the Backend class. The method is called with the general type of the variable ('f' or 'i') and the number of binary digits, and returns the string corresponding to the precision for the given backend. GarNet and GarNetStack classes in hls_model.py use this method to avoid explicitly mentioning ap_fixed and ap_int types.

Merge request reports

Loading