$ ./guess_the_languageAI & ML
AI & ML · easy · #24

What does this return?

import torch
torch.relu(torch.tensor([-2.0, 0.0, 3.0]))
  1. tensor([0., 0., 3.])
  2. tensor([-2., 0., 3.])
  3. tensor([0., 1., 3.])
  4. tensor([2., 0., 3.])
ReLU computes max(0, x), so negatives become 0 and positives pass through.
Play AI & ML ▸