本文整理匯總了Python中caffe2.python.core.BlobReference方法的典型用法代碼示例。如果您正苦於以下問題:Python core.BlobReference方法的具體用法?Python core.BlobReference怎麽用?Python core.BlobReference使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類caffe2.python.core
的用法示例。
在下文中一共展示了core.BlobReference方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: BlobReferenceList
# 需要導入模塊: from caffe2.python import core [as 別名]
# 或者: from caffe2.python.core import BlobReference [as 別名]
def BlobReferenceList(blob_ref_or_list):
"""Ensure that the argument is returned as a list of BlobReferences."""
if isinstance(blob_ref_or_list, core.BlobReference):
return [blob_ref_or_list]
elif type(blob_ref_or_list) in (list, tuple):
for b in blob_ref_or_list:
assert isinstance(b, core.BlobReference)
return blob_ref_or_list
else:
raise TypeError(
'blob_ref_or_list must be a BlobReference or a list/tuple of '
'BlobReferences'
)
示例2: blob_ref_to_list
# 需要導入模塊: from caffe2.python import core [as 別名]
# 或者: from caffe2.python.core import BlobReference [as 別名]
def blob_ref_to_list(blob_ref_or_list):
if isinstance(blob_ref_or_list, core.BlobReference):
return [blob_ref_or_list]
return blob_ref_or_list