Check returned value when the nn model file is already loaded.
Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
caffe2_open (const GstTensorFilterProperties * prop, void **private_data)
{
int ret = caffe2_loadModelFile (prop, private_data);
- g_assert (ret == 0); /** This must be called only once */
+ g_assert (ret >= 0); /** This must be called only once */
return ret;
}
torch_open (const GstTensorFilterProperties * prop, void **private_data)
{
gint ret = torch_loadModelFile (prop, private_data);
- g_assert (ret == 0); /** This must be called only once */
+ g_assert (ret >= 0); /** This must be called only once */
return ret;
}
tf_open (const GstTensorFilterProperties * prop, void **private_data)
{
int retval = tf_loadModelFile (prop, private_data);
- g_assert (retval == 0); /** This must be called only once */
+ g_assert (retval >= 0); /** This must be called only once */
return retval;
}
tflite_open (const GstTensorFilterProperties * prop, void **private_data)
{
int ret = tflite_loadModelFile (prop, private_data);
- g_assert (ret == 0); /** This must be called only once */
+ g_assert (ret >= 0); /** This must be called only once */
return ret;
}
* @param[in] prop read-only property values
* @param[in/out] private_data A subplugin may save its internal private data here. The subplugin is responsible for alloc/free of this pointer.
* @param[out] info structure of tensor info (return value)
- * @return the size of input tensors
+ * @return 0 if OK. non-zero if error.
*/
int (*getOutputDimension) (const GstTensorFilterProperties * prop,
* @param[in] prop read-only property values
* @param[in/out] private_data A subplugin may save its internal private data here. The subplugin is responsible for alloc/free of this pointer.
* @param[out] info structure of tensor info (return value)
- * @return the size of output tensors
+ * @return 0 if OK. non-zero if error.
*/
int (*setInputDimension) (const GstTensorFilterProperties * prop,
{
if (!priv->prop.fw_opened && priv->fw) {
if (priv->fw->open) {
- if (priv->fw->open (&priv->prop, &priv->privateData) == 0)
+ /* 0 if successfully loaded. 1 if skipped (already loaded). */
+ if (priv->fw->open (&priv->prop, &priv->privateData) >= 0)
priv->prop.fw_opened = TRUE;
} else {
priv->prop.fw_opened = TRUE;