随笔分类 -  模型压缩和加速

实现简单的straight-through estimator(STE)(pytorch版)
摘要:import torch input = torch.randn(4,requires_grad = True) output = torch.sign(input) loss = output.mean() loss.backward() print(input) print(input.grad 阅读全文

posted @ 2020-09-09 17:35 cltt 阅读(1480) 评论(0) 推荐(0)

计算模型的Para和GFLOPs
摘要:import torch.nn as nn import torch import torch.nn.functional as F class FP_Conv2d(nn.Module): def __init__(self, input_channels, output_channels, ker 阅读全文

posted @ 2020-08-28 15:49 cltt 阅读(899) 评论(0) 推荐(0)

导航