Creation ops
Generated from the binaries by scripts/gen-ops-reference.ts — do not edit by
hand. Every op also documents itself: torch <op> --help.
full
a tensor of the given shape filled with a value
torch full <shape> <value> [--dtype <Str>] [--requires_grad]torch full <shape> <value> [--dtype <Str>] [--requires_grad]randn
standard-normal random tensor (float kinds only)
torch randn <shape> [--dtype <Str>] [--requires_grad]torch randn <shape> [--dtype <Str>] [--requires_grad]zeros
a tensor of zeros
torch zeros <shape> [--dtype <Str>] [--requires_grad]torch zeros <shape> [--dtype <Str>] [--requires_grad]ones
a tensor of ones
torch ones <shape> [--dtype <Str>] [--requires_grad]torch ones <shape> [--dtype <Str>] [--requires_grad]eye
identity matrix (n x n, or n x —m)
torch eye <n> [--m <Int>]torch eye <n> [--m <Int>]arange
range [—start, end) by —step (CLI reshape of PyTorch overloads)
torch arange <end> [--start <Scalar>] [--step <Scalar>]torch arange <end> [--start <Scalar>] [--step <Scalar>]linspace
steps evenly spaced points in [start, end]
torch linspace <start> <end> <steps>torch linspace <start> <end> <steps>rand
uniform [0,1) random tensor (seeded CPU generator)
torch rand <shape> [--requires_grad]torch rand <shape> [--requires_grad]randint
random int64s in [—low, high) (seeded CPU generator)
torch randint <high> <shape> [--low <Int>]torch randint <high> <shape> [--low <Int>]zeros_like
zeros with the input’s shape and dtype
torch zeros_like <t1>torch zeros_like <t1>ones_like
ones with the input’s shape and dtype
torch ones_like <t1>torch ones_like <t1>full_like
a value-filled tensor with the input’s shape and dtype
torch full_like <t1> <value>torch full_like <t1> <value>rand_like
uniform random with the input’s shape (seeded CPU generator)
torch rand_like <t1>torch rand_like <t1>randn_like
normal random with the input’s shape (seeded CPU generator)
torch randn_like <t1>torch randn_like <t1>