Python apex.amp.float_function() Examples

The following are 1 code examples of apex.amp.float_function(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module apex.amp , or try the search function .
Example #1
Source File: roi_align.py    From training_results_v0.5 with Apache License 2.0 5 votes vote down vote up
def __init__(self, output_size, spatial_scale, sampling_ratio):
        super(ROIAlign, self).__init__()
        self.output_size = output_size
        self.spatial_scale = spatial_scale
        self.sampling_ratio = sampling_ratio

        if use_apex_amp:
            self.fwd = amp.float_function(self.fwd_impl)
        else:
            self.fwd = self.fwd_impl