| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent c233e70 commit 08862d2
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -232,18 +232,19 @@ public static Tensor mul_no_nan<Tx, Ty>(Tx x, Ty y, string name = null) | |||
| 232 | 232 | ||
| 233 | 233 | public static Tensor real(Tensor input, string name = null) | |
| 234 | 234 | { | |
| 235 | - using (var name_ = ops.name_scope(name, "Real", new [] {input})) | ||
| 235 | + return tf_with(ops.name_scope(name, "Real", new [] {input}), scope => | ||
| 236 | 236 | { | |
| 237 | + // name = scope; | ||
| 237 | 238 | input = ops.convert_to_tensor(input, name: "input"); | |
| 238 | 239 | if (input.dtype.is_complex()) | |
| 239 | 240 | { | |
| 240 | 241 | var real_dtype = input.dtype.real_dtype(); | |
| 241 | - return real(input, name: name); | ||
| 242 | + return real(input, name: scope); | ||
| 242 | 243 | } else | |
| 243 | 244 | { | |
| 244 | 245 | return input; | |
| 245 | 246 | } | |
| 246 | - } | ||
| 247 | + }); | ||
| 247 | 248 | } | |
| 248 | 249 | ||
| 249 | 250 | /// <summary> | |
@@ -317,11 +318,11 @@ public static Tensor reduce_std(Tensor input_tensor, int[] axis = null, bool kee | |||
| 317 | 318 | name = "reduce_std"; | |
| 318 | 319 | // else {name = name;} | |
| 319 | 320 | ||
| 320 | - using (ops.name_scope(name)) | ||
| 321 | + return tf_with(ops.name_scope(name, "reduce_std", new [] {input_tensor}), scope => | ||
| 321 | 322 | { | |
| 322 | 323 | var variance = reduce_variance(input_tensor, axis: axis, keepdims: keepdims); | |
| 323 | 324 | return gen_math_ops.sqrt(variance); | |
| 324 | - } | ||
| 325 | + }); | ||
| 325 | 326 | } | |
| 326 | 327 | ||
| 327 | 328 | public static Tensor reduce_variance(Tensor input_tensor, int[] axis = null, bool keepdims = false, string name = null) | |
@@ -330,7 +331,7 @@ public static Tensor reduce_variance(Tensor input_tensor, int[] axis = null, boo | |||
| 330 | 331 | name = "reduce_variance"; | |
| 331 | 332 | // else {name = name;} | |
| 332 | 333 | ||
| 333 | - using (ops.name_scope(name)) | ||
| 334 | + return tf_with(ops.name_scope(name, "reduce_variance", new [] {input_tensor}), scope => | ||
| 334 | 335 | { | |
| 335 | 336 | var means = reduce_mean(input_tensor, axis: axis, keepdims: true); | |
| 336 | 337 | if (means.dtype.is_integer()) | |
@@ -348,7 +349,7 @@ public static Tensor reduce_variance(Tensor input_tensor, int[] axis = null, boo | |||
| 348 | 349 | squared_deviations = gen_math_ops.square(diff); | |
| 349 | 350 | } | |
| 350 | 351 | return reduce_mean(squared_deviations, axis: axis, keepdims: keepdims); | |
| 351 | - } | ||
| 352 | + }); | ||
| 352 | 353 | } | |
| 353 | 354 | ||
| 354 | 355 | public static Tensor sigmoid<T>(T x, string name = null) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments