Caffe2 - C++ API
A deep learning, cross platform ML framework
remove_data_blocks_op.cc
1 
17 #include "caffe2/operators/remove_data_blocks_op.h"
18 
19 namespace caffe2 {
20 namespace {
21 REGISTER_CPU_OPERATOR(RemoveDataBlocks, RemoveDataBlocksOp<CPUContext>);
22 
23 OPERATOR_SCHEMA(RemoveDataBlocks)
24  .NumInputs(2)
25  .NumOutputs(1)
26  .SetDoc(R"DOC(
27 Shrink the data tensor by removing data blocks with given zero-based indices in
28 the outermost dimension of the tensor. Indices are not assumed in any order or
29 unique but with the range [0, blocks_size). Indices could be empty.
30  )DOC")
31  .Input(0, "data", "a N-D data tensor, N >= 1")
32  .Input(1, "indices", "zero-based indices of blocks to be removed")
33  .Output(
34  0,
35  "shrunk data",
36  "data after removing data blocks indexed by 'indices'");
37 
38 SHOULD_NOT_DO_GRADIENT(RemoveDataBlocks);
39 } // namespace
40 } // namespace caffe2
Copyright (c) 2016-present, Facebook, Inc.