pytorch使用过程中的一点心得体会

类似TensorFlow的h = tf.nn.bias_add(conv, b)
pytorch中直接两个Tensor相加即可,例子如下:

import torch

torch.manual_seed(2019)
a = torch.rand(2, 3, 4, 5)
print(a)
b = torch.ones(5)
print(b)
print(a + b)

你可能感兴趣的:(pytorch使用过程中的一点心得体会)