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
@@ -84,7 +84,8 @@ class CPUAttentionBackend(AttentionBackend):
|
||||
@classmethod
|
||||
def supports_attn_type(cls, attn_type: str) -> bool:
|
||||
"""CPU attention supports decoder,
|
||||
encoder-only and encoder-decoder attention."""
|
||||
encoder-only and encoder-decoder attention.
|
||||
"""
|
||||
return attn_type in (
|
||||
AttentionType.DECODER,
|
||||
AttentionType.ENCODER,
|
||||
@@ -349,14 +350,22 @@ class CPUAttentionBackendImpl(AttentionImpl):
|
||||
"""Forward pass for CPU attention backend.
|
||||
|
||||
Args:
|
||||
layer: The attention layer, providing the q/k/v quantization scales.
|
||||
query: shape = [num_tokens, num_heads, head_size]
|
||||
key: shape = [num_tokens, num_kv_heads, head_size]
|
||||
value: shape = [num_tokens, num_kv_heads, head_size]
|
||||
kv_cache: shape =
|
||||
[num_blocks, num_kv_heads, block_size, 2 * head_size]
|
||||
attn_metadata: Metadata for attention.
|
||||
output: Tensor that the attention result is written into.
|
||||
output_scale: Scale for fused output quantization; not supported
|
||||
by this backend.
|
||||
output_block_scale: Block scale for fused output quantization;
|
||||
not supported by this backend.
|
||||
|
||||
Returns:
|
||||
shape = [num_tokens, num_heads * head_size]
|
||||
|
||||
"""
|
||||
if output_scale is not None or output_block_scale is not None:
|
||||
raise NotImplementedError(
|
||||
|
||||
Reference in New Issue
Block a user