%matplotlib inline import torch import torch.nn as nn import numpy as np import sys sys.path.append(/home/kesci/input) import d2lzh1981 as d2l print(torch.__version__) def dropout(X, drop_prob): X = X.float() assert 0 <= drop_prob <= 1 keep_prob = 1 - drop_prob # 这种情况下把全部元素都丢弃