[IE][VPU]: Improves myriad plugin API (#2816)
LoadNetwork takes network argument by constant reference.
Myriad plugin implementation applies transformations to
given network in order to get compiled model.
Transformations take network argument by non-constant
reference, so at some point of time network copy must be
acquired. ICNNNetwork is neither copyable nor movable, so
the only way to get network copy is using special utility
returning std::shared_ptr.
Myriad plugin does not expose any ownership strategy,
so prefers to take network argument by simple reference.
Plugin also requires nGraph -> CNN conversion during
LoadNetwork implementation. Conversion utilities returns
std::shared_ptr, which makes plugin to use workaround for
lifetime of converted object (to have 2 "pointers" to
network: raw pointer to input network and smart pointer to
converted network). Such workarounds make code more
error-prone, because using wrong pointer to semantically
the same object may lead to unexpected results.
To overcome these issues API has been changed in a way to
make interfaces more clear (do not expose ownership strategy
or mutability) and get rid of unnecessary workarounds.
Signed-off-by: Gladilov, Gleb <gleb.gladilov@intel.com>