Caffe2 - C++ API
A deep learning, cross platform ML framework
Public Types | Static Public Member Functions | Static Public Attributes
caffe2::AbstractSparseLengthsDef< T, SIndex, Context, ReducerDef, GradientNeedIndices > Struct Template Reference

Public Types

using OpDef = ReducerDef
using Reducer = typename ReducerDef::template Reducer< T, Context >
using ReducerGradient = typename ReducerDef::template ReducerGradient< T, Context >
using ForwardOp = AbstractLengthsOp< T, SIndex, Context, Reducer >
using BackwardOp = AbstractLengthsGradientOp< T, SIndex, Context, ReducerGradient, false >
using WithMainInputBackwardOp = AbstractLengthsWithMainInputGradientOp< T, SIndex, Context, ReducerGradient >
using GetGradient = LengthsOpGetGradient< ForwardOp, ReducerDef, ReducerGradient, true, GradientNeedIndices >

Static Public Member Functions

static void PopulateSchema (OpSchema &schema)

Static Public Attributes

static constexpr const char * basename = "SparseLengths"
static constexpr const char * doc

Detailed Description

template<typename T, typename SIndex, typename Context, typename ReducerDef, bool GradientNeedIndices = false>
struct caffe2::AbstractSparseLengthsDef< T, SIndex, Context, ReducerDef, GradientNeedIndices >

Definition at line 1986 of file segment_reduction_op.h.

Field Documentation

template<typename T , typename SIndex , typename Context , typename ReducerDef , bool GradientNeedIndices = false>
constexpr const char* caffe2::AbstractSparseLengthsDef< T, SIndex, Context, ReducerDef, GradientNeedIndices >::doc
Initial value:
= R"DOC(
Pulls in slices of the input tensor, groups them into segments and applies
'{op}' to each segment. Segments are defined by their LENGTHS.
This op is basically Gather and Lengths{op} fused together.
INDICES should contain integers in range 0..N-1 where N is the first dimension
of DATA. INDICES represent which slices of DATA need to be pulled in.
LENGTHS is a vector that defines slice sizes by first dimention of DATA. Values
belonging to the same segment are aggregated together. sum(LENGTHS) has
to match INDICES size.
The first dimension of the output is equal to the number of input segment,
i.e. `len(LENGTHS)`. Other dimensions are inherited from the input tensor.

Definition at line 1989 of file segment_reduction_op.h.

The documentation for this struct was generated from the following file: