mirror of
https://github.com/pytorch/pytorch.git
synced 2025-11-03 15:35:04 +08:00
Summary: Adding train and algebra helpers Reviewed By: salexspb Differential Revision: D4884951 fbshipit-source-id: 7a18eb986a7356977a6c3d7a62a996ddce0c793e
19 lines
527 B
Python
19 lines
527 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)
|