Skip to content

Commit

Permalink
Add information about short-circuting (#1343)
Browse files Browse the repository at this point in the history
  • Loading branch information
msluszniak authored Oct 16, 2023
1 parent 7e59f9f commit 0ebeb81
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions nx/lib/nx.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6205,6 +6205,8 @@ defmodule Nx do
If you're using `Nx.Defn.defn/2`, you can use the `&&&` operator
in place of this function: `left &&& right`.
It does not support short-circuiting.
## Examples
### bitwise and between scalars
Expand Down Expand Up @@ -6258,6 +6260,8 @@ defmodule Nx do
If you're using `Nx.Defn.defn/2`, you can use the `|||` operator
in place of this function: `left ||| right`.
It does not support short-circuiting.
## Examples
### bitwise or between scalars
Expand Down
4 changes: 4 additions & 0 deletions nx/lib/nx/defn/kernel.ex
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,8 @@ defmodule Nx.Defn.Kernel do
It delegates to `Nx.logical_and/2` (supports broadcasting).
It does not support short-circuiting.
## Examples
defn and_or(a, b) do
Expand All @@ -548,6 +550,8 @@ defmodule Nx.Defn.Kernel do
It delegates to `Nx.logical_or/2` (supports broadcasting).
It does not support short-circuiting.
## Examples
defn and_or(a, b) do
Expand Down

0 comments on commit 0ebeb81

Please sign in to comment.