forked from ccf-ai-infra/GPUCodeForces
23 lines
381 B
Python
23 lines
381 B
Python
import torch
|
|
import torch.nn as nn
|
|
|
|
|
|
class Model(nn.Module):
|
|
def __init__(self):
|
|
super(Model, self).__init__()
|
|
|
|
def forward(self, log_probs: torch.Tensor) -> torch.Tensor:
|
|
loss = -log_probs.mean()
|
|
return loss
|
|
|
|
|
|
batch_size = 256
|
|
|
|
|
|
def get_inputs():
|
|
log_probs = torch.randn(batch_size)
|
|
return [log_probs]
|
|
|
|
|
|
def get_init_inputs():
|
|
return [] |