mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-14 20:57:59 +00:00
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/42927 added fp16 fusion to net transforms refactored the transforms as well as glow_transform to get out of opt/custom so that the OSS builds passed Test Plan: added net runner tests for this Reviewed By: yinghai Differential Revision: D23080881 fbshipit-source-id: ee6451811fedfd07c6560c178229854bca29301f
16 lines
429 B
Python
16 lines
429 B
Python
#!/usr/bin/env python3
|
|
from __future__ import division
|
|
from __future__ import print_function
|
|
from __future__ import unicode_literals
|
|
|
|
import caffe2.python._import_c_extension as C
|
|
from caffe2.proto.caffe2_pb2 import NetDef
|
|
|
|
def fakeFp16FuseOps(net : NetDef) -> NetDef:
|
|
net_str = net.SerializeToString()
|
|
|
|
out_str = C.fakeFp16FuseOps(net_str)
|
|
out_net = NetDef()
|
|
out_net.ParseFromString(out_str)
|
|
|
|
return out_net
|