vm.torch

Classes

class device : Represent the device spec.

class dtype : The basic data type.

class enable_grad : Context-manager to enable gradient calculation.

class no_grad : Context-manager to disable gradient calculation.

class set_grad_enabled : Context-manager to set gradient calculation on or off.

class Size : Represent the a sequence of dimensions.

class Tensor : A multi-dimensional array containing elements of a single data type.

Functions

abs(…) : Compute the absolute value of input.

add(…) : Compute the element-wise addition.

arange(…) : Return a tensor of evenly spaced values within a interval.

argmax(…) : Return the index of maximum elements along the given dimension.

argmin(…) : Return the index of minimum elements along the given dimension.

axpby(…) : Compute the element-wise addition from input to output.

bitwise_not(…) : Compute the element-wise NOT bitwise operation.

bitwise_xor(…) : Compute the element-wise XOR bitwise operation.

cat(…) : Concatenate the inputs along the given dimension.

ceil(…) : Compute the smallest integer not less than input.

channel_normalize(…) : Normalize channels with mean and standard deviation.

channel_shuffle(…) : Shuffle channels between a given number of groups. [Zhang et.al, 2017].

chunk(…) : Split input into a specific number of chunks.

clamp(…) : Compute the clipped input according to the given bounds.

cos(…) : Compute the cos of input.

cumsum(…) : Compute the cumulative sum of elements along the given dimension.

div(…) : Compute the element-wise division.

empty(…) : Return a tensor filled with uninitialized data.

eq(…) : Compute the element-wise equal comparison.

exp(…) : Compute the exponential of input.

eye(…) : Return a tensor constructed as the identity matrix.

flatten(…) : Return a tensor with dimensions flattened.

floor(…) : Compute the largest integer not greater than input.

from_numpy(…) : Create a tensor from the given numpy array.

ge(…) : Compute the element-wise greater-equal comparison.

gt(…) : Compute the element-wise greater comparison.

index_select(…) : Select the elements along the given dim using index.

isinf(…) : Check if the elements of input are infinite.

isnan(…) : Check if the elements of input are NaN.

le(…) : Compute the element-wise less-equal comparison.

log(…) : Compute the natural logarithm of input.

logsumexp(…) : Apply the composite of log, sum, and exp to input.

lt(…) : Compute the element-wise less comparison.

masked_select(…) : Select the input elements where mask is 1.

max(…) : Compute the max value of elements along the given dimension.

maximum(…) : Compute the maximum value of inputs.

mean(…) : Compute the mean value of elements along the given dimension.

min(…) : Compute the min value of elements along the given dimension.

minimum(…) : Compute the minimum value of inputs.

mm(…) : Perform a matrix multiplication.

mul(…) : Compute the element-wise multiplication.

multinomial(…) : Return a tensor with index sampled from multinomial distribution.

narrow(…) : Return a new tensor that is a narrowed version of input tensor.

ne(…) : Compute the element-wise not-equal comparison.

nonzero(…) : Return the index of non-zero elements.

ones(…) : Return a tensor filled with ones.

ones_like(…) : Return a tensor of ones with shape as the other.

one_hot(…) : Return the one-hot representation for input.

permute(…) : Return a new tensor with the specific order of dimensions.

pow(…) : Compute the power of input.

rand(…) : Return a tensor from the uniform distribution of U(0, 1).

randn(…) : Return a tensor from the normal distribution of N(0, 1).

randperm(…) : Return a tensor with value in the permuted range.

reciprocal(…) : Compute the reciprocal of input.

repeat(…) : Repeat elements along the specified dimensions.

reshape(…) : Change the shape of input.

round(…) : Compute the nearest integer of input.

rsqrt(…) : Compute the reciprocal square root of input.

sign(…) : Compute the sign indication of input.

sin(…) : Compute the sin of input.

split(…) : Split input into chunks along the given dimension.

sqrt(…) : Compute the square root of input.

squeeze(…) : Remove the dimensions of input with size 1.

stack(…) : Stack the inputs along the given dimension.

sub(…) : Compute the element-wise subtraction.

sum(…) : Compute the sum value of elements along the given dimension.

tensor(…) : Create a tensor initializing the content from data.

topk(…) : Return the top-K largest or smallest elements along the given dimension.

unique(…) : Return the unique elements of input.

unsqueeze(…) : Expand the dimensions of input with size 1.

where(…) : Select the elements from two branches under the condition.

zeros(…) : Return a tensor filled with zeros.

zeros_like(…) : Return a tensor of zeros with shape as the other.