Skip to content

Commit

Permalink
性能微小优化
Browse files Browse the repository at this point in the history
  • Loading branch information
fangwei123456 committed Sep 8, 2020
1 parent 1817db5 commit d8225c7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions spikingjelly/datasets/n_mnist.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,8 @@ def read_bin(file_name: str):
raw_data = np.uint32(np.fromfile(bin_f, dtype=np.uint8))
x = raw_data[0::5]
y = raw_data[1::5]
rd_2__5 = raw_data[2::5]
p = (rd_2__5 & 128) >> 7 # bit 7
t = ((rd_2__5 & 127) << 16) | (raw_data[3::5] << 8) | (raw_data[4::5])
p = (raw_data[2::5] & 128) >> 7 # bit 7
t = ((raw_data[2::5] & 127) << 16) | (raw_data[3::5] << 8) | (raw_data[4::5])
return {'t': t, 'x': x, 'y': y, 'p': p}

@staticmethod
Expand Down

0 comments on commit d8225c7

Please sign in to comment.