def my_dropout(x, ratio, train): if version < '2.0': return F.dropout(x, ratio=ratio, train=train) else: # v2.0 return F.dropout(x, ratio=ratio)