[inplace opt] Support in-place no-op flatten layer
This patch updates the flatten layer to be a no-op layer. This is done
with the flatten layer setting the input and output shapes at finalize
time and making flatten layer execute in-place. Changes in this patch:
1. requestPreallocatedTensor() in TensorPool now returns a new tensor
which will eventually share the memory with the preallocated tensor than
returning the preallocated tensor itself. This allows tensor metadata to
be changed (like name, shape, etc) which sharing the memory. This is
done by storing the dependency link between tensors in token.
Corresponding unittests are also added.
2. Manager now supports giving shared tensors for outputs (shared with
some inputs) to support in-place running of some layers.
3. Flatten layer is updated to be a basic no-op and to perform
flattening once at compile time.
4. Update flatten layer supportBackwarding to true
5. Input layer updated to not edit tensor mapping. Input layer will be
updated to be in-place in the next patch.
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>