Skip to content
fn

drop_path_op

→TensorImplPtr
int drop_path_op(const int & a, double p, bool scale_by_keep, Generator * gen)

DropPath — per-sample stochastic depth — free-function entry point.

Thin wrapper that delegates to DropPathBackward::forward.

Parameters

aTensorImplPtr
Input tensor of rank ≥1\geq 1; first axis is the batch axis.
pdouble
Per-sample drop probability in [0,1)[0, 1).
scale_by_keepbool
Whether to rescale surviving samples by 1/(1−p)1 / (1 - p).
Optional RNG; nullptr selects default_generator().

Returns

TensorImplPtr

Output tensor of the same shape as a.