當前位置: 首頁>>代碼示例>>Python>>正文


Python dyndep.InitOpsLibrary方法代碼示例

本文整理匯總了Python中caffe2.python.dyndep.InitOpsLibrary方法的典型用法代碼示例。如果您正苦於以下問題:Python dyndep.InitOpsLibrary方法的具體用法?Python dyndep.InitOpsLibrary怎麽用?Python dyndep.InitOpsLibrary使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在caffe2.python.dyndep的用法示例。


在下文中一共展示了dyndep.InitOpsLibrary方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: import_detectron_ops

# 需要導入模塊: from caffe2.python import dyndep [as 別名]
# 或者: from caffe2.python.dyndep import InitOpsLibrary [as 別名]
def import_detectron_ops():
    """Import Detectron ops."""
    detectron_ops_lib = envu.get_detectron_ops_lib()
    dyndep.InitOpsLibrary(detectron_ops_lib) 
開發者ID:yihui-he,項目名稱:KL-Loss,代碼行數:6,代碼來源:c2.py

示例2: import_custom_ops

# 需要導入模塊: from caffe2.python import dyndep [as 別名]
# 或者: from caffe2.python.dyndep import InitOpsLibrary [as 別名]
def import_custom_ops():
    """Import custom ops."""
    custom_ops_lib = envu.get_custom_ops_lib()
    dyndep.InitOpsLibrary(custom_ops_lib) 
開發者ID:yihui-he,項目名稱:KL-Loss,代碼行數:6,代碼來源:c2.py

示例3: import_detectron_ops

# 需要導入模塊: from caffe2.python import dyndep [as 別名]
# 或者: from caffe2.python.dyndep import InitOpsLibrary [as 別名]
def import_detectron_ops():
    """Import Detectron ops."""
    detectron_ops_lib = get_detectron_ops_lib()
    dyndep.InitOpsLibrary(detectron_ops_lib) 
開發者ID:facebookresearch,項目名稱:video-long-term-feature-banks,代碼行數:6,代碼來源:c2.py

示例4: _load_custom_dll

# 需要導入模塊: from caffe2.python import dyndep [as 別名]
# 或者: from caffe2.python.dyndep import InitOpsLibrary [as 別名]
def _load_custom_dll():
    global custom_ops_loaded
    if not custom_ops_loaded:
        import os
        lib_name = 'libcaffe2_mpi_operations.so'
        CUSTOM_OPERATIONS = 'CUSTOM_OPERATIONS'
        if CUSTOM_OPERATIONS not in os.environ:
            raise Exception('Set the custom operator '
                            'directory via the environment variable: {}'
                            .format(lib_name, CUSTOM_OPERATIONS))
        path = os.environ[CUSTOM_OPERATIONS] + "/" + lib_name
        if not os.path.isfile(path):
            raise FileNotFoundError('File not found in path: {}'.format(path))
        dyndep.InitOpsLibrary(path)
        custom_ops_loaded = True 
開發者ID:deep500,項目名稱:deep500,代碼行數:17,代碼來源:caffe2_distributed_optimizer.py

示例5: import_custom_ops

# 需要導入模塊: from caffe2.python import dyndep [as 別名]
# 或者: from caffe2.python.dyndep import InitOpsLibrary [as 別名]
def import_custom_ops():
    """Import custom and contrib ops needed by this software."""
    # TODO(rbg): Consider moving into either model_builder or
    # DetectionModelHelper

    dyndep.InitOpsLibrary('@/caffe2/caffe2/contrib/nccl:nccl_ops')
    ops_path = '@/experimental/deeplearning/rgirdhar/VideoPose/lib/ops'
    ops_to_import = [
        'roi_pool_f_op',
        'ps_roi_pool_op',
        'l1_loss_op',
        'smooth_l1_loss_op',
        'affine_channel_op',
        'sigmoid_cross_entropy_loss_op',
        'upsample_nearest_op',
        'integral_image_op',
        'roi_pool_late_quantization_op',
        'roi_warp_op',
        'roi_warp_max_op',
        'spatial_narrow_as_op',
        'sample_as_op',
        'roi_align_op',
        'batch_permutation_op',
        'affine_channel_nd_op',
        # Doesn't work yet.. the CUDA version is not available and will not compile
        # 'conv_transpose_3d_op',
    ]
    for op in ops_to_import:
        dyndep.InitOpsLibrary(ops_path + ':' + op) 
開發者ID:facebookresearch,項目名稱:DetectAndTrack,代碼行數:31,代碼來源:net.py


注:本文中的caffe2.python.dyndep.InitOpsLibrary方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。