Skip to content

Instantly share code, notes, and snippets.

@shangeth
Created December 27, 2018 06:01
Show Gist options
  • Save shangeth/3a51cbb617736e007bb473673536fb82 to your computer and use it in GitHub Desktop.
Save shangeth/3a51cbb617736e007bb473673536fb82 to your computer and use it in GitHub Desktop.
import torch
x = np.random.randn(3,3)
x_tensor = torch.from_numpy(x)
dropout = torch.nn.Dropout(0.5)
dropout(x_tensor)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment