-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. use_cudnn=False 2. fix saving checkponint 3. using compiled program
- Loading branch information
1 parent
a8976f5
commit 8875bb2
Showing
4 changed files
with
42 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,10 +3,12 @@ | |
import numpy as np | ||
import os | ||
|
||
use_cudnn = True | ||
# cudnn is not better when batch size is 1. | ||
use_cudnn = False | ||
if 'ce_mode' in os.environ: | ||
use_cudnn = False | ||
|
||
|
||
def cal_padding(img_size, stride, filter_size, dilation=1): | ||
"""Calculate padding size.""" | ||
valid_filter_size = dilation * (filter_size - 1) + 1 | ||
|
@@ -18,6 +20,8 @@ def cal_padding(img_size, stride, filter_size, dilation=1): | |
|
||
|
||
def instance_norm(input, name=None): | ||
# TODO([email protected]): Check the accuracy when using fluid.layers.layer_norm. | ||
# return fluid.layers.layer_norm(input, begin_norm_axis=2) | ||
helper = fluid.layer_helper.LayerHelper("instance_norm", **locals()) | ||
dtype = helper.input_dtype() | ||
epsilon = 1e-5 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters