Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/OpenNMT/CTranslate2
/ num_bytes
Method
num_bytes
python/ctranslate2/specs/model_spec.py:743–744 ·
view source on GitHub ↗
(self)
Source
from the content-addressed store, hash-verified
741
return
self.tensor.detach().numpy()
742
743
def
num_bytes(self) -> int:
744
return
self.tensor.numel() * self.tensor.element_size()
745
746
def
to_bytes(self) -> bytes:
747
max_size = 2**31 - 1
Callers
1
to_bytes
Method · 0.95
Calls
no outgoing calls
Tested by
no test coverage detected