Skip to content

Commit 9b0e9c3

Browse files
authored
Merge pull request #91 from ryanvergel/2.5
Updated pytorchsubgraphs
2 parents 3990372 + 1739865 commit 9b0e9c3

File tree

2 files changed

+4
-36
lines changed

2 files changed

+4
-36
lines changed

Tutorials/pytorch-subgraphs/README.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,11 @@ Author: Daniele Bagni, Xilinx Inc
2727
</table>
2828
</div>
2929

30-
### Current status
3130

32-
1. Tested with PyTorch 1.7.1 within [Vitis AI 2.0](https://github.com/Xilinx/Vitis-AI/tree/v2.0) on an Ubuntu 18.04.5 Desktop PC and tested in hardware on VCK190 Production board (``xilinx-vck190-dpu-v2021.2-v2.2.0.img.gz``) and ZCU102 board (``xilinx-zcu102-dpu-v2021.2-v2.0.0.img.gz``) both from the Vitis AI 2.0.
31+
- Version: Vitis AI 2.5
32+
- Support: ZCU102
33+
- Last update: 21 Mar. 2023
3334

34-
1. Tested with PyTorch 1.7.1 within [Vitis AI 2.5](https://github.com/Xilinx/Vitis-AI) on an Ubuntu 18.04.5 Desktop PC and tested in hardware on VCK190 Production board (``xilinx-vck190-dpu-v2022.1-v2.5.0.img.gz``) and ZCU102 board (``xilinx-zcu102-dpu-v2022.1-v2.5.0.img.gz``) both from the Vitis AI 2.5.
35-
36-
37-
38-
#### Date: 20 June 2022
3935

4036

4137

Tutorials/pytorch-subgraphs/files/application/main_subgraphs.py

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
"""
1919

2020
"""
21-
Author: Daniele Bagni & Jon Cory
22-
date: 20 June 2022
21+
date: 20 Mar 2023
2322
"""
2423

2524
from ctypes import *
@@ -116,33 +115,6 @@ def Linear(xx):
116115
np.save('cnn_out.bin', y)
117116
return y
118117

119-
"""
120-
# yet to be checked
121-
def LeakyReLU(K, x):
122-
data = np.asarray( x, dtype="float32" )
123-
print("LKRE inp shape ", data.shape)
124-
size = data[0].size
125-
shape = data[0].shape
126-
d = data[0].reshape([1, size])
127-
print("LKRE inp: ", d)
128-
pos_index = (d >= 0);
129-
neg_index = (d < 0); Linear(out6)
130-
coef = np.float32(K)
131-
y_n = d[np.ix_(neg_index)]*coef
132-
y_p = d[np.ix_(pos_index)]
133-
y = [y_n, y_p]
134-
print("LKRE out: ", y)
135-
x[0] = y.reshape([shape])
136-
return x
137-
"""
138-
139-
def fix2float(fix_point, value):
140-
return value.astype(np.float32) * np.exp2(fix_point, dtype=np.float32)
141-
142-
143-
def float2fix(fix_point, value):
144-
return value.astype(np.float32) / np.exp2(fix_point, dtype=np.float32)
145-
146118

147119
def execute_async(dpu, tensor_buffers_dict):
148120
input_tensor_buffers = [

0 commit comments

Comments
 (0)