MyCaffe
1.12.2.41
Deep learning software for Windows C# programmers.
DictionaryEx.cs
1
using
System
;
2
using
System
.Collections.Generic;
3
using
System
.Linq;
4
using
System
.Text;
5
6
namespace
MyCaffe.common
7
{
8
#pragma warning disable 1591
9
10
public
class
DictionaryEx<TKey, TValue> : Dictionary<TKey, TValue>
11
{
12
TValue m_tDefault;
13
14
public
DictionaryEx(TValue tDefault)
15
: base()
16
{
17
m_tDefault = tDefault;
18
}
19
20
public
new
TValue
this
[TKey k]
21
{
22
get
23
{
24
if
(!Keys.Contains(k))
25
Add(k, m_tDefault);
26
27
return
base[k];
28
}
29
set
30
{
31
if
(!Keys.Contains(k))
32
Add(k, value);
33
else
34
base[k] = value;
35
}
36
}
37
}
38
39
#pragma warning restore 1591
40
}
MyCaffe.common
The MyCaffe.common namespace contains common MyCaffe classes.
Definition:
BatchInput.cs:8
System
Definition:
Component.cs:11
MyCaffe is currated by
Help generated by
1.8.13