Skip to content

Commit

Permalink
Fix pytorch storage warnings, fixes #80 (#88)
Browse files Browse the repository at this point in the history
we seriously don't care what type of storage we get, pytorch sucks
  • Loading branch information
LoganDark committed Jun 3, 2023
1 parent 3f8bb2c commit fb6708b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rwkv/rwkv_cpp_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def validate_buffer(buf: torch.Tensor, name: str, size: int) -> None:
if state_in is not None:
validate_buffer(state_in, 'state_in', self._state_buffer_element_count)

state_in_ptr = state_in.untyped_storage().data_ptr()
state_in_ptr = state_in.data_ptr()
else:
state_in_ptr = 0

Expand All @@ -102,8 +102,8 @@ def validate_buffer(buf: torch.Tensor, name: str, size: int) -> None:
self._ctx,
token,
state_in_ptr,
state_out.untyped_storage().data_ptr(),
logits_out.untyped_storage().data_ptr()
state_out.data_ptr(),
logits_out.data_ptr()
)

return logits_out, state_out
Expand Down

0 comments on commit fb6708b

Please sign in to comment.