Add slice and gather syntax Summary: Implemented syntactic sugar for the following constructs: - `x.Gather(y)` can now be written as `x[y]` - `x.Slice(start, end)` can now be written as `x[start:end]` For slicing, `start` and/or `end` can be omitted iff `x` is one-dimensional (i.e. a vector). That is, `vector[start:]`, `vector[:end]` and `vector[:]` will work. Doesn't work for higher-dimensional tensors because to emit the start/end indices we need to know the rank of the tensor (since `Slice` requires one entry per dimension of the tensor). Also added a `getProto()` function so that I could test that the generated code is as expected (i.e. that the syntactic sugar does not affect the structure of the output). Reviewed By: zdevito Differential Revision: D6605864 fbshipit-source-id: 786359713a13314c24be2fc07e01486c507404ef
Caffe2 is a lightweight, modular, and scalable deep learning framework. Building on the original Caffe, Caffe2 is designed with expression, speed, and modularity in mind.
Caffe2 research award competition request for proposals
Please use Github issues (https://github.com/caffe2/caffe2/issues) to ask questions, report bugs, and request new features.
Please participate in our survey (https://www.surveymonkey.com/r/caffe2). We will send you information about new releases and special developer events/webinars.
Caffe2 is released under the Apache 2.0 license. See the NOTICE file for details.