singa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <>
Subject [jira] [Commented] (SINGA-198) Change Layer::Setup API to include input Tensor shapes
Date Fri, 17 Jun 2016 06:39:05 GMT


ASF subversion and git services commented on SINGA-198:

Commit 74f02143a22b0f3c478a45716beac7fb087b0e7b in incubator-singa's branch refs/heads/dev
from [~flytosky]
[;h=74f0214 ]

SINGA-198 - Change Layer::Setup API to include input Tensor shapes

Update the setup function from
void Setup(const LayerConf& conf);
void Setup(const Shape& in_sample_shape, const LayerConf& conf);  // for single input
void Setup(const vector<Shape>& in_sample_shapes, const LayerConf& conf); //
for multiple outputs

functions for getting output sample shape are added
const Shape GetOutputSampleShape() const;  // used for single output
const Shape GetOutputSampleShape(int k) const;  // used for multiple outputs

pass tests.

> Change Layer::Setup API to include input Tensor shapes
> ------------------------------------------------------
>                 Key: SINGA-198
>                 URL:
>             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

View raw message