wangwei created SINGA-198:
-----------------------------
Summary: Change Layer::Setup API to include input Tensor shapes
Key: SINGA-198
URL: https://issues.apache.org/jira/browse/SINGA-198
Project: Singa
Issue Type: Improvement
Reporter: wangwei
For some layers, they require input Tensor shapes to setup their own data
structures, e.g., parameters.
Previously, we get those shape data from layer configuration (i.e., the
protobuf object). This ticket is going to pass the input Tensor shapes as an
argument to the Layer::Setup function. There are two cases:
1. there is a single input Tensor, then shape is a vector<size_t>
2. there are multiple input Tensor, then shape is vector<vector<size_t>>
During setup, we may not know the batchsize, hence we use the shapes for one
sample/example/instance. In other words, batchsize is not included in the
shapes. E.g., the shape for convoltuion::Setup has three values for channel,
height and width, while batchsize is not included.
Corresponding, we need a get_output_shapes function, which returns the shape of
the features generated by this layer. It should be called after calling
Layer::Setup.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)