Variable marian::shift¶
Defined in File tensor_operators.h
Variable Documentation¶
-
Expr marian::shift= 0.f) { auto rnd = resultTensor->getBackend()->getRandomGenerator(); rnd->uniform(resultTensor, 0.f, 1.f); using namespace functional; Element(_1 = (_1 < keepProb) * scale + shift, resultTensor);}static inline void Dropout(Tensor tensor, float dropProb) { float keepProb = 1.f - dropProb; float scale = 1.f / keepProb; Bernoulli(tensor, keepProb, scale, 0.f);}DISPATCH2(SinusoidalPositionEmbeddings, marian::Tensor, int)
Shifts the elements of an expression by a per-axis offset
shift
padded withpadValue
.