diff --git a/src/finn/custom_op/fpgadataflow/streamingmaxpool.py b/src/finn/custom_op/fpgadataflow/streamingmaxpool.py index a4259f5b63d094c4b0d357992217f19b40da53a3..2419575de097ec34e689862a57442f66351a5164 100644 --- a/src/finn/custom_op/fpgadataflow/streamingmaxpool.py +++ b/src/finn/custom_op/fpgadataflow/streamingmaxpool.py @@ -24,19 +24,20 @@ class StreamingMaxPool(HLSCustomOp): temp_files.append("input_{}.npy".format(in_ind)) in_ind += 1 self.code_generation(node) + temp_files.append("execute_StreamingMaxPool.cpp") bash_compile = """g++ -o execute_StreamingMaxPool execute_StreamingMaxPool.cpp /workspace/finn/cnpy/cnpy.cpp -I/workspace/finn/cnpy/ -I/workspace/finn/finn-hlslib -I/workspace/vivado-hlslib --std=c++11 -lz""" process_compile = subprocess.Popen(bash_compile.split(), stdout=subprocess.PIPE) process_compile.communicate() bash_execute = "./execute_StreamingMaxPool" process_execute = subprocess.Popen(bash_compile.split(), stdout=subprocess.PIPE) process_execute.communicate() + temp_files.append("execute_StreamingMaxPool") + temp_files.append("output.npy") output = np.load("output.npy") - for i in range(output.shape[0]): - print(np.transpose(output[i])) - ## deleting temporary files - #for temp_file in temp_files: - # os.remove(temp_file) - sys.exit(0) + context[node.output[0]]=output + # deleting temporary files + for temp_file in temp_files: + os.remove(temp_file) def get_attributes(self, node): self.ImgDim = get_by_name(node.attribute, 'ImgDim').i diff --git a/tests/test_layer_streaming_maxpool.py b/tests/test_layer_streaming_maxpool.py index 7b87138877959b5b1c7e6485363108518eb401df..4c9806a3571a5455fed23febf816b7e94a47c188 100644 --- a/tests/test_layer_streaming_maxpool.py +++ b/tests/test_layer_streaming_maxpool.py @@ -77,4 +77,4 @@ def test_layer_streaming_maxpool(): input_dict = {"in": input_tensor} output_dict = oxe.execute_onnx(model, input_dict) - print(output_dict[outp]) + print(output_dict)