forked from SciSharp/TensorFlow.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsmart_module.cs
More file actions
29 lines (26 loc) · 727 Bytes
/
smart_module.cs
File metadata and controls
29 lines (26 loc) · 727 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System;
using System.Collections.Generic;
using System.Text;
namespace Tensorflow.Framework
{
public class smart_module
{
public static Tensor[] smart_cond<T>(Tensor pred,
Func<T[]> true_fn = null,
Func<T[]> false_fn = null,
string name = null)
{
return control_flow_ops.cond(pred,
true_fn: true_fn,
false_fn: false_fn,
name: name);
}
public static bool? smart_constant_value(Tensor pred)
{
var pred_value = tensor_util.constant_value(pred);
if (pred_value is null)
return null;
return pred_value;
}
}
}