From b3d1e8433e4b84f8b93f6f5ebbe7e89f44ba9b53 Mon Sep 17 00:00:00 2001 From: mmrahorovic <mmrahorovic@hotmail.com> Date: Tue, 22 Feb 2022 12:28:38 +0000 Subject: [PATCH] [custom_op]: remainder_size is moved to hls custom-op --- src/finn/custom_op/fpgadataflow/streamingmaxpool_batch.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/finn/custom_op/fpgadataflow/streamingmaxpool_batch.py b/src/finn/custom_op/fpgadataflow/streamingmaxpool_batch.py index 263707e4d..d2e1406d2 100755 --- a/src/finn/custom_op/fpgadataflow/streamingmaxpool_batch.py +++ b/src/finn/custom_op/fpgadataflow/streamingmaxpool_batch.py @@ -202,21 +202,17 @@ class StreamingMaxPool_Batch(HLSCustomOp): ifm_dim, k, ifm_ch = self.get_1d_attrs_normalized() ceil_mode = self.get_nodeattr("CeilMode") output_size = compute_pool_output_dim(ifm_dim[1], k[1], k[1], 0, ceil_mode) - remainder_size = ifm_dim[1] - k[1] * output_size - if remainder_size < 0: - remainder_size = 0 if self.is_1d(): self.code_gen_dict["$DEFINES$"] = [ """#define ImgDim {}\n #define PoolDim {}\n #define NumChannels {}\n #define PE {}\n #define OutputSize {} - \n #define RemainderSize {}\n #define numReps {}""".format( + \n #define numReps {}""".format( ifm_dim[1], k[1], self.get_nodeattr("NumChannels"), self.get_nodeattr("PE"), output_size, - remainder_size, numReps, ) ] @@ -276,7 +272,7 @@ class StreamingMaxPool_Batch(HLSCustomOp): op = "StreamingMaxPool_Precision_1d" self.code_gen_dict["$DOCOMPUTE$"] = [ """%s<ImgDim, PoolDim, NumChannels, PE, - OutputSize, RemainderSize, %s, %s>(in0, out);""" + OutputSize, %s, %s>(in0, out);""" % (op, dtype_hls, minval_str) ] else: -- GitLab