Torch.Indef.Dynamic.Tensor.Math.Pointwise

Description

Element-wise functions.

Synopsis

# Documentation

Arguments

 :: Dynamic tensor a -> Dynamic tensor b (same size as tensor a in dimension below) -> Word dimension to operate over -> Dynamic new return tensor

returns the cross product of vectors in the specified dimension

a and b must have the same size, and both a:size(n) and b:size(n) must be 3.

sign_ :: Dynamic -> IO () Source #

Replaces all elements in-place with the sign of the elements of the tensor.

Returns a new Tensor with the sign (+/- 1) of the elements of a tensor

clamp_ :: Dynamic -> HsReal -> HsReal -> IO () Source #

Clamp all elements, inplace, in the tensor into the range [min_value, max_value]. ie:

        { min_value, if x_i < min_value
y_i = { x_i,       if min_value ≤ x_i ≤ max_value
{ max_value, if x_i > max_value


pure version of clamp_ returning a new tensor as output.

Arguments

 :: Dynamic tensor1 -> HsReal scale term to multiply againts tensor2 -> Dynamic tensor2 -> IO ()

Multiply elements of tensor2 by the scalar value and add it to tensor1. The number of elements must match, but sizes do not matter.

Stores the result in tensor1.

Arguments

 :: Dynamic tensor1 -> HsReal scale term to multiply againts tensor2 -> Dynamic tensor2 -> Dynamic

Multiply elements of tensor2 by the scalar value and add it to tensor1. The number of elements must match, but sizes do not matter.

inline alias to cadd

Arguments

 :: Dynamic tensor1 -> HsReal scale term to multiply againts tensor2 -> Dynamic tensor2 -> IO ()

Multiply elements of tensor2 by the scalar value and subtract it from tensor1. The number of elements must match, but sizes do not matter.

Stores the result in tensor1.

Arguments

 :: Dynamic tensor1 -> HsReal scale term to multiply againts tensor2 -> Dynamic tensor2 -> Dynamic

Multiply elements of tensor2 by the scalar value and subtract it from tensor1. The number of elements must match, but sizes do not matter.

inline alias to csub

Arguments

 :: Dynamic tensor1 -> Dynamic tensor2 -> IO ()

Performs the element-wise multiplication of tensor1 by tensor2. The number of elements must match, but sizes do not matter.

Stores the result in tensor1.

Arguments

 :: Dynamic tensor1 -> Dynamic tensor2 -> Dynamic

Performs the element-wise multiplication of tensor1 by tensor2. The number of elements must match, but sizes do not matter.

inline alias to cmul

square a tensor.

FIXME: this is a call to cmul but it might be better to use pow

Arguments

 :: Dynamic tensor1 -> Dynamic tensor2 -> IO ()

Performs the element-wise division of tensor1 by tensor2. The number of elements must match, but sizes do not matter.

Stores the result in tensor1.

Arguments

 :: Dynamic tensor1 -> Dynamic tensor2 -> Dynamic

Performs the element-wise division of tensor1 by tensor2. The number of elements must match, but sizes do not matter.

inline alias to cdiv

Arguments

 :: Dynamic tensor1 -> Dynamic tensor2 -> IO ()

Element-wise power operation, taking the elements of tensor1 to the powers given by elements of tensor2. The number of elements must match, but sizes do not matter.

Stores the result in tensor1.

Arguments

 :: Dynamic tensor1 -> Dynamic tensor2 -> Dynamic

Element-wise power operation, taking the elements of tensor1 to the powers given by elements of tensor2. The number of elements must match, but sizes do not matter.

clshift_ :: Dynamic -> Dynamic -> IO () Source #

Element-wise, inplace, bitwise left shift. Mutates the first argument.

Element-wise bitwise left shift.

crshift_ :: Dynamic -> Dynamic -> IO () Source #

Element-wise, inplace, bitwise right shift. Mutates the first argument.

Element-wise bitwise right shift.

Arguments

 :: Dynamic tensor1 -> Dynamic tensor2 -> IO ()

Computes the element-wise remainder of the division (rounded towards zero) of tensor1 by tensor2. The number of elements must match, but sizes do not matter.

Stores the result in tensor1.

Arguments

 :: Dynamic tensor1 -> Dynamic tensor2 -> Dynamic

Computes the element-wise remainder of the division (rounded towards zero) of tensor1 by tensor2. The number of elements must match, but sizes do not matter.

Arguments

 :: Dynamic tensor1 -> Dynamic tensor2 -> IO ()

Computes element-wise remainder of the division (rounded to nearest) of tensor1 by tensor2. The number of elements must match, but sizes do not matter.

Stores the result in tensor1.

Arguments

 :: Dynamic tensor1 -> Dynamic tensor2 -> Dynamic

Computes element-wise remainder of the division (rounded to nearest) of tensor1 by tensor2. The number of elements must match, but sizes do not matter.

cmax_ :: Dynamic -> Dynamic -> IO () Source #

Element-wise, inplace, max function -- storing the higher value. Mutates the first argument.

Element-wise max function -- keeping the higher value.

cmin_ :: Dynamic -> Dynamic -> IO () Source #

Element-wise, inplace, min function -- storing the lower value. Mutates the first argument.

Element-wise min function -- keeping the lower value.

cmaxValue_ :: Dynamic -> HsReal -> IO () Source #

Store the maximum of the tensor and a scalar in the input tensor on an element-by-element basis.

Store the maximum of the tensor and a scalar in a new tensor on an element-by-element basis.

cminValue_ :: Dynamic -> HsReal -> IO () Source #

Store the minimum of the tensor and a scalar in the input tensor on an element-by-element basis.

Store the minimum of the tensor and a scalar in a new tensor on an element-by-element basis.

cbitand_ :: Dynamic -> Dynamic -> IO () Source #

Element-wise, inplace, bitwise and. Mutates the first argument.

Element-wise, bitwise and

cbitor_ :: Dynamic -> Dynamic -> IO () Source #

Element-wise, inplace, bitwise or. Mutates the first argument.

Element-wise, bitwise or

cbitxor_ :: Dynamic -> Dynamic -> IO () Source #

Element-wise, inplace, bitwise xor. Mutates the first argument.

Element-wise, bitwise xor

Arguments

 :: Dynamic tensor0 -> HsReal scale term -> Dynamic tensor1 -> Dynamic tensor2 -> IO ()

Performs the element-wise multiplication of tensor1 by tensor2, multiplies the result by the scalar value and adds it to tensor0, which it mutates inplace.

The number of elements must match, but sizes do not matter.

Arguments

 :: Dynamic tensor0 -> HsReal scale term -> Dynamic tensor1 -> Dynamic tensor2 -> Dynamic

Performs the element-wise multiplication of tensor1 by tensor2, multiplies the result by the scalar value and adds it to tensor0.

The number of elements must match, but sizes do not matter.

Arguments

 :: Dynamic tensor0 -> HsReal scale term -> Dynamic tensor1 -> Dynamic tensor2 -> IO ()

Performs the element-wise multiplication of tensor1 by tensor2, multiplies the result by the scalar value and adds it to tensor0, which it mutates inplace.

The number of elements must match, but sizes do not matter.

Arguments

 :: Dynamic tensor0 -> HsReal scale term -> Dynamic tensor1 -> Dynamic tensor2 -> Dynamic

Performs the element-wise division of tensor1 by tensor2, multiplies the result by the scalar value and adds it to tensor0.

The number of elements must match, but sizes do not matter.