Comparison ops

Unreleased native NuTorch shell reference. Generated by scripts/gen-ops-reference.ts; every op also documents itself with torch <op> --help. Tensor operands are native values, not strings.

eq

elementwise equality (returns a Bool tensor)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch eq <t1> <t2>

allclose

true if all elements are close (returns a bool)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch allclose <t1> <t2> [--rtol <Float>] [--atol <Float>]

sort

sort along —dim (default last); returns values and indices

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch sort <t1> [--dim <Int>] [--descending]

gt

elementwise a > b (Bool, broadcasting)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch gt <t1> <t2>

lt

elementwise a < b (Bool, broadcasting)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch lt <t1> <t2>

ge

elementwise a >= b (Bool, broadcasting)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch ge <t1> <t2>

le

elementwise a <= b (Bool, broadcasting)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch le <t1> <t2>

ne

elementwise a != b (Bool, broadcasting)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch ne <t1> <t2>

logical_and

elementwise logical AND (Bool, broadcasting)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch logical_and <t1> <t2>

logical_or

elementwise logical OR (Bool, broadcasting)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch logical_or <t1> <t2>

logical_xor

elementwise logical XOR (Bool, broadcasting)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch logical_xor <t1> <t2>

isclose

elementwise closeness (Bool; —rtol/—atol)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch isclose <t1> <t2> [--rtol <Float>] [--atol <Float>]

isnan

elementwise NaN test (Bool)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch isnan <t1>

isinf

elementwise infinity test (Bool)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch isinf <t1>

isfinite

elementwise finiteness test (Bool)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch isfinite <t1>

isposinf

elementwise +inf test (Bool)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch isposinf <t1>

isneginf

elementwise -inf test (Bool)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch isneginf <t1>

logical_not

elementwise logical NOT (Bool)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch logical_not <t1>

equal

whole-tensor equality (returns a bool)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch equal <t1> <t2>

topk

top-k values+indices (—smallest = PyTorch largest=False, a NuTorch-ism)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch topk <t1> <k> [--dim <Int>] [--smallest]

argsort

indices that would sort along —dim (default last)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch argsort <t1> [--dim <Int>] [--descending]

searchsorted

insertion indices: searchsorted(sorted_seq, values)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch searchsorted <t1> <t2>

bucketize

bucket indices: bucketize(values, boundaries)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch bucketize <t1> <t2>

msort

sort along the first dimension (values only)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch msort <t1>

unique

sorted unique values

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch unique <t1>