@@ -66,14 +66,24 @@ public static Tensor decode_jpeg(Tensor contents,
6666 int ratio = 1 ,
6767 bool fancy_upscaling = true ,
6868 bool try_recover_truncated = false ,
69- float acceptable_fraction = 1 ,
69+ int acceptable_fraction = 1 ,
7070 string dct_method = "" ,
7171 string name = null )
7272 {
7373 // Add nodes to the TensorFlow graph.
7474 if ( tf . Context . executing_eagerly ( ) )
7575 {
76- throw new NotImplementedException ( "decode_jpeg" ) ;
76+ var results = tf . Runner . TFE_FastPathExecute ( tf . Context , tf . Context . DeviceName ,
77+ "DecodeJpeg" , name ,
78+ null ,
79+ contents ,
80+ "channels" , channels ,
81+ "ratio" , ratio ,
82+ "fancy_upscaling" , fancy_upscaling ,
83+ "try_recover_truncated" , try_recover_truncated ,
84+ "acceptable_fraction" , acceptable_fraction ,
85+ "dct_method" , dct_method ) ;
86+ return results [ 0 ] ;
7787 }
7888 else
7989 {
@@ -171,17 +181,42 @@ public static Tensor resize_bilinear(Tensor images,
171181 "half_pixel_centers" , half_pixel_centers ) ;
172182 return results [ 0 ] ;
173183 }
174- else
184+
185+ var _op = tf . OpDefLib . _apply_op_helper ( "ResizeBilinear" , name : name , args : new
175186 {
176- var _op = tf . OpDefLib . _apply_op_helper ( "ResizeBilinear" , name : name , args : new
177- {
178- images ,
179- size ,
180- align_corners
181- } ) ;
187+ images ,
188+ size ,
189+ align_corners
190+ } ) ;
182191
183- return _op . outputs [ 0 ] ;
192+ return _op . outputs [ 0 ] ;
193+ }
194+
195+ public static Tensor resize_bicubic ( Tensor images ,
196+ Tensor size ,
197+ bool align_corners = false ,
198+ bool half_pixel_centers = false ,
199+ string name = null )
200+ {
201+ if ( tf . Context . executing_eagerly ( ) )
202+ {
203+ var results = tf . Runner . TFE_FastPathExecute ( tf . Context , tf . Context . DeviceName ,
204+ "ResizeBicubic" , name ,
205+ null ,
206+ images , size ,
207+ "align_corners" , align_corners ,
208+ "half_pixel_centers" , half_pixel_centers ) ;
209+ return results [ 0 ] ;
184210 }
211+
212+ var _op = tf . OpDefLib . _apply_op_helper ( "ResizeBicubic" , name : name , args : new
213+ {
214+ images ,
215+ size ,
216+ align_corners
217+ } ) ;
218+
219+ return _op . outputs [ 0 ] ;
185220 }
186221
187222 public static Tensor resize_nearest_neighbor < Tsize > ( Tensor images , Tsize size , bool align_corners = false ,
0 commit comments