Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def infoget(res):
return utils.list2dict(res)
If True, only the meta data will be fetched, not the model blob
Returns
-------
dict
A dictionary of model details such as device, backend etc. The model
blob will be available at the key 'blob'
Example
-------
>>> con.modelget('model', meta_only=True)
{'backend': 'TF', 'device': 'cpu', 'tag': 'v1.0'}
"""
args = builder.modelget(key, meta_only)
rv = self.execute_command(*args)
return utils.list2dict(rv)
def scriptget(res):
return utils.list2dict(res)
Model key
Returns
-------
dict
Dictionary of model run details
Example
-------
>>> con.infoget('m')
{'key': 'm', 'type': 'MODEL', 'backend': 'TF', 'device': 'cpu', 'tag': '',
'duration': 0, 'samples': 0, 'calls': 0, 'errors': 0}
"""
args = builder.infoget(key)
ret = self.execute_command(*args)
return utils.list2dict(ret)
def tensorget(res, as_numpy, meta_only):
"""Process the tensorget output.
If ``as_numpy`` is True, it'll be converted to a numpy array. The required
information such as datatype and shape must be in ``rai_result`` itself.
"""
rai_result = utils.list2dict(res)
if meta_only:
return rai_result
elif as_numpy is True:
return utils.blob2numpy(rai_result['blob'], rai_result['shape'], rai_result['dtype'])
else:
target = float if rai_result['dtype'] in ('FLOAT', 'DOUBLE') else int
utils.recursive_bytetransform(rai_result['values'], target)
return rai_result