Adding the GarNet layer and an example project
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 whenLayer.add_weights_variable
is called with a specifiedprecision
, even when thetype_name
argument is None. Otherwise repeated calls withprecision
not None buttype_name
None will keep using the default type name and overwriting the precision specified in the previous call. - In
templates.py
andvivado_template.py
, added a methodget_precision
to theBackend
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
andGarNetStack
classes in hls_model.py use this method to avoid explicitly mentioningap_fixed
andap_int
types.