mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 13:44:15 +08:00
Summary: rename model_helpers to brew. This is a big diff now. I did these things: 1. replace model_helpers with brew: find . -type f -exec sed -i 's/model_helpers/brew/g' {} + 2. rename model_helpers.py and model_helpers_test.py 3. rename ModelHelpersTest to BrewTest 4. lowercase all the helper functions to distinguish them from single op 5. run my unittests 6. run converge tests Reviewed By: salexspb Differential Revision: D4930465 fbshipit-source-id: f420a1b03238df1cbe9f4426e0b9c43a12119661
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)
|