Text Generation
PEFT
Safetensors
lora
reinforcement-learning
code
hip
rocm
gpu-kernels
ik6626's picture
HIP kernel RL LoRA: step 75 (root) and step 125
35564ed verified
Raw History Blame Contribute Delete
474 Bytes
import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self):
super().__init__()
def forward(self, x, target):
x = torch.eq(x, target)
criterion = nn.MSELoss()
return criterion(x, target)
batch_size = 256
height = 512
width = 1024
def get_inputs():
x = torch.randn(batch_size, height, width)
target = torch.randn(batch_size, height, width)
return [x, target]
def get_init_inputs():
return []