mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
Summary: PR 1175 caused a build error because gemmBatched was only under a specific #ifdef. Now put it outside the #ifdef, and things work. Reviewed By: asaadaldien Differential Revision: D5834868 fbshipit-source-id: 072a64c8f4b259ff7504104121766115b46b8aa0
27 lines
758 B
Python
27 lines
758 B
Python
## @package algebra
|
|
# Module caffe2.python.helpers.algebra
|
|
from __future__ import absolute_import
|
|
from __future__ import division
|
|
from __future__ import print_function
|
|
from __future__ import unicode_literals
|
|
|
|
|
|
def transpose(model, blob_in, blob_out, use_cudnn=False, **kwargs):
|
|
"""Transpose."""
|
|
if use_cudnn:
|
|
kwargs['engine'] = 'CUDNN'
|
|
return model.net.Transpose(blob_in, blob_out, **kwargs)
|
|
|
|
|
|
def sum(model, blob_in, blob_out, **kwargs):
|
|
"""Sum"""
|
|
return model.net.Sum(blob_in, blob_out, **kwargs)
|
|
|
|
|
|
def batch_mat_mul(model, blob_in, blob_out,
|
|
enable_tensor_core=False, **kwargs):
|
|
if enable_tensor_core:
|
|
kwargs['engine'] = 'TENSORCORE'
|
|
|
|
return model.net.BatchMatMul(blob_in, blob_out, **kwargs)
|