Skip to content

Small mistake in nn.Threshold documentation #2025

@dmarnerides

Description

@dmarnerides

Hello,

In the documentation it says

y =  x      if x >= threshold
     value  if x <  threshold

So the following:
torch.nn.Threshold(1,0)(torch.Tensor([1]))
should evaluate to 1, but instead returns 0.

Maybe it should be corrected to:

y =  x      if x > threshold
     value  if x <=  threshold

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions