I was looking at the example:
http://pytorch.org/tutorials/beginner/examples_autograd/two_layer_net_autograd.html 459
and has the line:
# Forward pass: compute predicted y using operations on Variables; these
# are exactly the same operations we used to compute the forward pass using
# Tensors, but we do not need to keep references to intermediate values since
# we are not implementing the backward pass by hand.
y_pred = x.mm(w1).clamp(min=0).mm(w2)

I read the documentation for clamp:
torch.clamp(input, min, max, out=None) → Tensor
Clamp all elements in input into the range [min, max] and return a resulting Tensor.

http://pytorch.org/docs/master/torch.html#torch.clamp 1.3k
but it didn’t make sense to me. Why do we need to do such a weird thing? Tensorflow doesn’t “clamp” anything during matrix multiplication why does pytorch?