MCPcopy
hub / github.com/ray-project/ray / memory_string

Function memory_string

python/ray/data/_internal/execution/util.py:62–68  ·  view source on GitHub ↗

Return a human-readable memory string for the given amount of bytes.

(num_bytes: float)

Source from the content-addressed store, hash-verified

60
61
62def memory_string(num_bytes: float) -> str:
63 """Return a human-readable memory string for the given amount of bytes."""
64 k = 0
65 while num_bytes >= 1024 and k < len(memory_units) - 1:
66 num_bytes /= 1024
67 k += 1
68 return f"{num_bytes:.1f}{memory_units[k]}"
69
70
71def locality_string(locality_hits: int, locality_misses) -> str:

Callers 13

write_datasinkMethod · 0.90
addMethod · 0.90
_derive_metadataFunction · 0.90
detectMethod · 0.90
__str__Method · 0.90
format_op_state_summaryFunction · 0.90
get_op_usage_strMethod · 0.90
_warn_large_udfMethod · 0.90
__repr__Method · 0.90

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…