Skip to content

Commit e5605f1

Browse files
small changes to transposes
1 parent fcafe5d commit e5605f1

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

hls4ml/model/types.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ def __init__(self, var_name, type_name, precision, data, quantizer=None, keep_di
229229
self.data = data
230230
self.nzeros = -1
231231
self.shape = list(self.data.shape)
232-
print("Weight Variable shape object creation:", self.shape)
233232
self.data_length = np.prod(self.data.shape)
234233
self.nonzeros = np.count_nonzero(self.data)
235234
self.nzeros = self.data_length - self.nonzeros

hls4ml/templates/vivado/nnet_utils/nnet_conv1dtranspose_stream.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ void kernel_shift_tr_1d(
1313
typename data_T::value_type kernel_window[CONFIG_T::trfilt_width * CONFIG_T::n_chan]
1414
) {
1515
#pragma HLS INLINE
16-
#pragma HLS PIPELINE II = 1
1716

1817
// Shift kernel_window by one step to the left (manual shift operation)
1918
static const int filt_width = CONFIG_T::trfilt_width - 1;
2019
KernelShiftWidth: for (int i_iw = 0; i_iw < filt_width; i_iw++) {
21-
#pragma HLS UNROLL
20+
#pragma HLS PIPELINE II = 1
2221
KernelShiftChannel: for (unsigned i_ic = 0; i_ic < CONFIG_T::n_chan; i_ic++) {
22+
#pragma HLS UNROLL
2323
// Shift every element in kernel_window to the left
2424
kernel_window[i_iw * CONFIG_T::n_chan + i_ic] = kernel_window[(i_iw + 1) * CONFIG_T::n_chan + i_ic];
2525
}

hls4ml/templates/vivado/nnet_utils/nnet_conv2dtranspose_resource.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ void conv_2d_transpose_resource_cl(
115115

116116
StrideHeightResultLoop:
117117
for (unsigned i_sh = 0; i_sh < CONFIG_T::stride_height; i_sh++) {
118+
#pragma HLS UNROLL
118119
StrideWidthResultLoop:
119120
for (unsigned i_sw = 0; i_sw < CONFIG_T::stride_width; i_sw++) {
120121
#pragma HLS UNROLL
@@ -125,8 +126,7 @@ void conv_2d_transpose_resource_cl(
125126

126127
if (height_ind >= CONFIG_T::pad_top && height_ind < CONFIG_T::out_height + CONFIG_T::pad_top &&
127128
width_ind >= CONFIG_T::pad_left && width_ind < CONFIG_T::out_width + CONFIG_T::pad_left) {
128-
ResultLoop:
129-
for (unsigned i_res = 0; i_res < mult_n_out; i_res++) {
129+
ResultLoop: for (unsigned i_res = 0; i_res < mult_n_out; i_res++) {
130130
#pragma HLS UNROLL
131131

132132
res[((height_ind-CONFIG_T::pad_top)*CONFIG_T::out_width + width_ind-CONFIG_T::pad_left)*

0 commit comments

Comments
 (0)