@@ -32,135 +33,40 @@ class DygraphInterpolateBilinearFuser(FuseBase):
defbuild_pattern(self):
""" 描述需要替换的双线性插值图结构。
interpolate_bilinear层模式python实现代码示例:
x3016 = fluid.layers.shape(input=x3005)
x3016 = len(x3016)
x3017 = x3016 - 2
x3018 = []
for _x3020 in range(x3017):
x3018.append(None)
x3021 = (x3005, x8, None, None)
x3022 = fluid.layers.shape(input=x3005)
x3022 = len(x3022)
x3023 = x3022 == 3
if x3023 :
x2195 = x2181.shape
x2195 = len(x2195)
x2196 = x2195 - 2
x2197 = []
for _x2199 in range(x2196):
x2197.append(None)
x2200 = (x2181, x8, None, None)
...
x2267 = x2266 == 3
if x2267 :
raise RaiseException('Exception')
x3024 = None
x2268 = None
else:
x3026 = fluid.layers.shape(input=x3005)
x3026 = len(x3026)
x3027 = x3026 == 4
if x3027 :
x3044, x3045, x3046, x3047 = x3021
x3048 = x3045 is None
if x3048 :
x3051 = x3046 is None
x3049 = x3051
x3050 = x3045
else:
x3052 = x3045
x3049 = False
x3050 = x3052
if x3049 :
raise RaiseException('Exception')
x3055 = x3050 is not None
if x3055 :
x3058 = x3050
x3059 = x3046 is not None
x3056 = x3059
x3057 = x3058
else:
x3056 = False
x3057 = x3050
if x3056 :
raise RaiseException('Exception')
x3060 = None
x3061 = None
else:
x3060 = x3046
x3061 = x3057
x3063 = x3060 is not None
if x3063 :
x3065 = x3060
x3066 = len(x3065)
x3067 = x3066 != 2
if x3067 :
raise RaiseException('Exception')
x3064 = x3065
else:
x3064 = x3060
x3070 = x3061 is not None
if x3070 :
x3072 = x3061
x3071 = x3072
else:
x3071 = None
if x3070 :
x3073 = x3071
else:
x3074 = x3064 is not None
if x3074 :
x3076 = x3064
x3075 = x3076
else:
raise RaiseException('Exception')
x3075 = None
x3078 = x3047 is None
if x3078 :
x3080 = len(x3075)
x3081 = x3080 > 0
x3086 = 0
for x3083 in range(2147483647):
x3087 = x3075[x3086]
x3088 = math.floor(x3087)
x3089 = x3088 != x3087
if x3089 :
x3090 = False
x3091 = x3089
else:
x3090 = None
x3091 = None
if x3089 :
x3092 = x3090
x3093 = x3091
else:
x3092 = True
x3093 = x3089
x3094 = x3086 + 1
x3095 = x3094 < x3080
x3096 = x3095 and x3092
x3082 = x3093
x3083 = x3094
if x3082 :
import warnings
warnings.warn('The default behavior for interpolate/upsample with float scale_factor will change in 1.6.0 to align with other frameworks/libraries, and use scale_factor directly, instead of relying on the computed output size. If you wish to keep the old behavior, please set recompute_scale_factor=True. See the documentation of nn.Upsample for details. ', stacklevel=2)