Rate this Page

torch.nn.functional.dropout#

torch.nn.functional.dropout(input,p=0.5,training=True,inplace=False)[source]#

During training, randomly zeroes some elements of the input tensor with probabilityp.

Uses samples from a Bernoulli distribution.

SeeDropout for details.

Parameters
  • p (float) – probability of an element to be zeroed. Default: 0.5

  • training (bool) – apply dropout if isTrue. Default:True

  • inplace (bool) – If set toTrue, will do this operation in-place. Default:False

Return type

Tensor