TileOPs-Metax/workloads/activation.py

15 lines
344 B
Python

import torch
from workloads.base import WorkloadBase
class ReluTest(WorkloadBase):
def __init__(self, n_total: int, dtype: torch.dtype):
self.n_total = n_total
self.dtype = dtype
def gen_inputs(self) -> tuple[torch.Tensor]:
x = torch.randn(self.n_total, dtype=self.dtype, device="cuda")
return (x,)