Skip to content

Commit d886e84

Browse files
committed
update transpose.py
1 parent 5af4fc4 commit d886e84

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

examples/transpose.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
"""
2-
Rambo benchmark
2+
Transpose benchmark
3+
4+
Matrix transpose benchmark for sharpy and numpy backends.
35
46
Examples:
57
6-
# run 1000 iterations of 10 events and 100 outputs on sharpy backend
7-
python rambo.py -nevts 10 -nout 100 -b sharpy -i 1000
8+
# Run 1000 iterations of 1000*1000 matrix on sharpy backend
9+
python transpose.py -r 10 -c 1000 -b sharpy -i 1000
810
911
# MPI parallel run
10-
mpiexec -n 3 python rambo.py -nevts 64 -nout 64 -b sharpy -i 1000
12+
mpiexec -n 3 python transpose.py -r 1000 -c 1000 -b sharpy -i 1000
1113
1214
"""
1315

@@ -43,7 +45,7 @@ def sp_transpose(arr):
4345

4446

4547
def np_transpose(arr):
46-
return arr.transpose()
48+
return numpy.ravel(arr.transpose()).reshape(arr.shape)
4749

4850

4951
def initialize(np, row, col, dtype):

0 commit comments

Comments
 (0)