File size: 397 Bytes
e14d114
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from typing import Optional

import torch

from .functional import selective_state_update


def selective_update(x: torch.Tensor, out: Optional[torch.Tensor] = None) -> torch.Tensor:
    """Legacy scaffold kernel — adds 1.0 to each element."""
    if out is None:
        out = torch.empty_like(x)
    out.copy_(x + 1.0)
    return out


__all__ = ["selective_update", "selective_state_update"]