Reduction 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.

sum

sum over all elements, or along —dim

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

use torch
torch sum <t1> [--dim <Int>] [--keepdim]

mean

mean over all elements, or along —dim (float32, v1 fidelity)

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

use torch
torch mean <t1> [--dim <Int>] [--keepdim]

prod

product over all elements, or along —dim

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

use torch
torch prod <t1> [--dim <Int>] [--keepdim]

amax

max values over all elements, or along —dim

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

use torch
torch amax <t1> [--dim <Int>] [--keepdim]

amin

min values over all elements, or along —dim

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

use torch
torch amin <t1> [--dim <Int>] [--keepdim]

max

max of all elements; with —dim also returns indices

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

use torch
torch max <t1> [--dim <Int>] [--keepdim]

min

min of all elements; with —dim also returns indices

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

use torch
torch min <t1> [--dim <Int>] [--keepdim]

median

median of all elements; with —dim also returns indices

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

use torch
torch median <t1> [--dim <Int>] [--keepdim]

argmax

index of the max, overall or along —dim

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

use torch
torch argmax <t1> [--dim <Int>] [--keepdim]

argmin

index of the min, overall or along —dim

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

use torch
torch argmin <t1> [--dim <Int>] [--keepdim]

all

true if all elements are true (Bool tensor)

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

use torch
torch all <t1> [--dim <Int>] [--keepdim]

any

true if any element is true (Bool tensor)

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

use torch
torch any <t1> [--dim <Int>] [--keepdim]

std

standard deviation (—correction, default 1)

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

use torch
torch std <t1> [--dim <Int>] [--keepdim] [--correction <Int>]

var

variance (—correction, default 1)

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

use torch
torch var <t1> [--dim <Int>] [--keepdim] [--correction <Int>]

nansum

sum treating NaN as zero

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

use torch
torch nansum <t1> [--dim <Int>] [--keepdim]

logsumexp

log(sum(exp(x))) along —dim

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

use torch
torch logsumexp <t1> [--dim <Int>] [--keepdim]

count_nonzero

count of nonzero elements, overall or along —dim

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

use torch
torch count_nonzero <t1> [--dim <Int>]

cumsum

cumulative sum along —dim

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

use torch
torch cumsum <t1> [--dim <Int>]

cumprod

cumulative product along —dim

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

use torch
torch cumprod <t1> [--dim <Int>]

norm

p-norm (—p default 2), overall or along —dim

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

use torch
torch norm <t1> [--p <Float>] [--dim <Int>] [--keepdim]

diff

forward differences along —dim (default last)

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

use torch
torch diff <t1> [--dim <Int>]