TopKLastDimOp

Trait TopKLastDimOp 

Source
pub trait TopKLastDimOp {
    // Required methods
    fn topk(&self, topk: usize) -> Result<TopKOutput>;
    fn topk_unsorted(&self, topk: usize) -> Result<TopKOutput>;
}

Required Methods§

Source

fn topk(&self, topk: usize) -> Result<TopKOutput>

Topk in the last dim. values retains a gradient but indices has none w.r.t self. This expects a contiguous tensor. Note: this implements torch.topk with sorted=True.

Source

fn topk_unsorted(&self, topk: usize) -> Result<TopKOutput>

Topk in the last dim. values retains a gradient but indices has none w.r.t self. This expects a contiguous tensor. Note: this implements torch.topk with sorted=False.

Implementations on Foreign Types§

Source§

impl TopKLastDimOp for Tensor

Source§

fn topk(&self, topk: usize) -> Result<TopKOutput>

Source§

fn topk_unsorted(&self, topk: usize) -> Result<TopKOutput>

Implementors§