Unverified Commit ae8da019 authored by wang jiahao's avatar wang jiahao Committed by GitHub
Browse files

Merge pull request #330 from hrz6976/fix-nonetype

thanks..., I was about to submit and found that you had already modified it. Thank you for your contribution
parents 56382aa8 4516282c
......@@ -172,7 +172,8 @@ class StaticCache(transformers.StaticCache):
for layer_idx in range(len(self.key_cache)):
# In-place ops prevent breaking the static address
self.key_cache[layer_idx].zero_()
self.value_cache[layer_idx].zero_()
if self.value_cache[layer_idx] is not None:
self.value_cache[layer_idx].zero_()
def get_max_cache_shape(self) -> Tuple[int, int, int, int]:
"""Returns the maximum shape of the cache."""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment