gitrepo_top_sample_50 / thop /tests /test_relu.py
Dorothydu's picture
Upload 50 random repository samples
9d3c8f5 verified
import pytest
import torch
import torch.nn as nn
from thop import profile
class TestUtils:
def test_relu(self):
n, in_c, out_c = 1, 100, 200
data = torch.randn(n, in_c)
net = nn.ReLU()
flops, params = profile(net, inputs=(torch.randn(n, in_c), ))
print(flops, params)
assert flops == 0