forked from SciSharp/TensorFlow.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDimension.cs
More file actions
29 lines (24 loc) · 693 Bytes
/
Dimension.cs
File metadata and controls
29 lines (24 loc) · 693 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
namespace Tensorflow
{
public class Dimension
{
int _value;
public int value => _value;
public Dimension(int value)
{
_value = value;
}
public Dimension merge_with(Dimension other)
{
if (_value == -1)
return new Dimension(other.value);
else
return new Dimension(_value);
}
public static implicit operator Dimension(int value)
=> new Dimension(value);
public static implicit operator int(Dimension dimension)
=> dimension.value;
public override string ToString() => $"Dimension({_value})";
}
}