mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-09-19 05:54:20 +00:00
use i&i-1 to judge if it is a power of 2
This commit is contained in:
parent
2057124004
commit
e3e8b1990c
@ -1252,8 +1252,8 @@ class EmformerEncoder(nn.Module):
|
||||
):
|
||||
super().__init__()
|
||||
|
||||
assert int(math.log(chunk_length, 2)) == math.log(
|
||||
chunk_length, 2
|
||||
assert (
|
||||
chunk_length - 1 & chunk_length == 0
|
||||
), "chunk_length should be a power of 2."
|
||||
|
||||
self.use_memory = memory_size > 0
|
||||
|
@ -1188,8 +1188,8 @@ class EmformerEncoder(nn.Module):
|
||||
):
|
||||
super().__init__()
|
||||
|
||||
assert int(math.log(chunk_length, 2)) == math.log(
|
||||
chunk_length, 2
|
||||
assert (
|
||||
chunk_length - 1 & chunk_length == 0
|
||||
), "chunk_length should be a power of 2."
|
||||
|
||||
self.use_memory = memory_size > 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user