def shape(self, as_list=True):
"""
Returns the size of the self tensor as a FloatTensor (or as List).
Note:
The returned value currently is a FloatTensor because it leverages
the messaging mechanism with Unity.
Parameters
----------
as_list : bool
Value retruned as list if true; else as tensor
Returns
-------
FloatTensor
Output tensor
(or)
Iterable
Output list
"""
if (as_list):
return list(np.fromstring(self.get("shape")[:-1], sep=",").astype('int'))
else:
shape_tensor = self.no_params_func("shape", return_response=True)
return shape_tensor
评论列表
文章目录