class

Num::MaskedTensor(T, S, M)

Inherits Reference < Object

Constructors

new(data : Tensor(T, S), mask : Tensor(Bool, M))
Source

Instance methods

*(other : MaskedTensor(T, S, M)) : MaskedTensor(T, S, M)

Element-wise multiplication combining masks

Source
+(other : MaskedTensor(T, S, M)) : MaskedTensor(T, S, M)

Element-wise addition combining masks (propagates true mask)

Source
-(other : MaskedTensor(T, S, M)) : MaskedTensor(T, S, M)

Element-wise subtraction combining masks

Source
data
Source
mask
Source
mean

Computes mean of only unmasked elements

Source
shape
Source
size
Source
sum

Computes sum of only unmasked elements

Source
to_a

Retrieves all unmasked elements as a flat array

Source