Caffe2 - Python API
A deep learning, cross platform ML framework
algebra.py
1 ## @package algebra
2 # Module caffe2.python.helpers.algebra
3 from __future__ import absolute_import
4 from __future__ import division
5 from __future__ import print_function
6 from __future__ import unicode_literals
7 
8 
9 def transpose(model, blob_in, blob_out, use_cudnn=False, **kwargs):
10  """Transpose."""
11  if use_cudnn:
12  kwargs['engine'] = 'CUDNN'
13  return model.net.Transpose(blob_in, blob_out, **kwargs)
14 
15 
16 def sum(model, blob_in, blob_out, **kwargs):
17  """Sum"""
18  return model.net.Sum(blob_in, blob_out, **kwargs)
19 
20 
21 def batch_mat_mul(model, blob_in, blob_out,
22  enable_tensor_core=False, **kwargs):
23  if enable_tensor_core:
24  kwargs['engine'] = 'TENSORCORE'
25 
26  return model.net.BatchMatMul(blob_in, blob_out, **kwargs)