2020年8月28日

pytorch tensor 的拼接和拆分

摘要: torch.catimport torch a=torch.randn(3,4) #随机生成一个shape(3,4)的tensort b=torch.randn(2,4) #随机生成一个shape(2,4)的tensor print("a:") print(a) print("b:") print( 阅读全文

posted @ 2020-08-28 21:17 cltt 阅读(1869) 评论(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 阅读(838) 评论(0) 推荐(0) 编辑

导航