Add pydocstyle to the ruff rules (#52136)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> Signed-off-by: Harry Mellor <hej.mellor@gmail.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
804e5377aa
commit
8c1557a79c
@@ -123,6 +123,7 @@ class WorkspaceManager:
|
||||
|
||||
Returns:
|
||||
List of tensor views into the workspace buffer, one per shape/dtype pair.
|
||||
|
||||
"""
|
||||
actual_bytes = [_compute_bytes(s, d) for s, d in shapes_and_dtypes]
|
||||
aligned_bytes = [round_up(actual, 256) for actual in actual_bytes]
|
||||
@@ -148,6 +149,7 @@ class WorkspaceManager:
|
||||
|
||||
Returns:
|
||||
The current workspace tensor.
|
||||
|
||||
"""
|
||||
ubatch_id = dbo_current_ubatch_id()
|
||||
lane = _workspace_lane.get()
|
||||
@@ -228,6 +230,7 @@ def is_workspace_manager_initialized() -> bool:
|
||||
|
||||
Returns:
|
||||
True if workspace manager is initialized, False otherwise.
|
||||
|
||||
"""
|
||||
return _manager is not None
|
||||
|
||||
@@ -237,6 +240,7 @@ def current_workspace_manager() -> "WorkspaceManager":
|
||||
|
||||
Raises:
|
||||
AssertionError: If workspace manager has not been initialized.
|
||||
|
||||
"""
|
||||
assert _manager is not None, (
|
||||
"WorkspaceManager not initialized. Call init_workspace_manager() "
|
||||
@@ -259,6 +263,7 @@ def init_workspace_manager(
|
||||
device: The device to allocate workspace on.
|
||||
num_ubatches: Number of workspace ubatch slots. Defaults to 1.
|
||||
num_lanes: Number of independent execution lanes per ubatch. Defaults to 1.
|
||||
|
||||
"""
|
||||
global _manager
|
||||
if _manager is not None:
|
||||
@@ -289,6 +294,7 @@ def lock_workspace() -> None:
|
||||
lock_workspace()
|
||||
|
||||
# Now all get_workspace calls must fit in pre-allocated size
|
||||
|
||||
"""
|
||||
current_workspace_manager().lock()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user