NuTorch

Comparison ops

Generated from the binaries by scripts/gen-ops-reference.ts — do not edit by hand. Every op also documents itself: torch <op> --help.

eq

elementwise equality (returns a Bool tensor)

torch eq <t1> <t2>

allclose

true if all elements are close (returns a JSON bool)

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

sort

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

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

gt

elementwise a > b (Bool, broadcasting)

torch gt <t1> <t2>

lt

elementwise a < b (Bool, broadcasting)

torch lt <t1> <t2>

ge

elementwise a >= b (Bool, broadcasting)

torch ge <t1> <t2>

le

elementwise a <= b (Bool, broadcasting)

torch le <t1> <t2>

ne

elementwise a != b (Bool, broadcasting)

torch ne <t1> <t2>

logical_and

elementwise logical AND (Bool, broadcasting)

torch logical_and <t1> <t2>

logical_or

elementwise logical OR (Bool, broadcasting)

torch logical_or <t1> <t2>

logical_xor

elementwise logical XOR (Bool, broadcasting)

torch logical_xor <t1> <t2>

isclose

elementwise closeness (Bool; —rtol/—atol)

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

isnan

elementwise NaN test (Bool)

torch isnan <t1>

isinf

elementwise infinity test (Bool)

torch isinf <t1>

isfinite

elementwise finiteness test (Bool)

torch isfinite <t1>

isposinf

elementwise +inf test (Bool)

torch isposinf <t1>

isneginf

elementwise -inf test (Bool)

torch isneginf <t1>

logical_not

elementwise logical NOT (Bool)

torch logical_not <t1>

equal

whole-tensor equality (returns a JSON bool)

torch equal <t1> <t2>

topk

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

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

argsort

indices that would sort along —dim (default last)

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

searchsorted

insertion indices: searchsorted(sorted_seq, values)

torch searchsorted <t1> <t2>

bucketize

bucket indices: bucketize(values, boundaries)

torch bucketize <t1> <t2>

msort

sort along the first dimension (values only)

torch msort <t1>

unique

sorted unique values

torch unique <t1>