FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
TensorFlow.NET/src/TensorFlowNET.Keras/Engine/Model.Build.cs at master · feelsyt/TensorFlow.NET · GitHub
feelsyt
/
TensorFlow.NET
Public
forked from
SciSharp/TensorFlow.NET
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
TensorFlow.NET
/
src
/
TensorFlowNET.Keras
/
Engine
/
Model.Build.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
51 lines (48 loc) · 1.91 KB
Breadcrumbs
TensorFlow.NET
/
src
/
TensorFlowNET.Keras
/
Engine
/
Model.Build.cs
Copy path
File metadata and controls
51 lines (48 loc) · 1.91 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using
System
;
using
System
.
Linq
;
using
Tensorflow
.
Graphs
;
using
Tensorflow
.
Keras
.
Saving
;
using
Tensorflow
.
Keras
.
Utils
;
using
static
Tensorflow
.
Binding
;
using
static
Tensorflow
.
KerasApi
;
namespace
Tensorflow
.
Keras
.
Engine
{
public
partial
class
Model
{
public
override
void
build
(
KerasShapesWrapper
input_shape
)
{
if
(
_is_graph_network
||
this
is
Functional
||
this
is
Sequential
)
{
base
.
build
(
input_shape
)
;
return
;
}
if
(
input_shape
is
not
null
&&
this
.
inputs
is
null
)
{
var
graph
=
tf
.
executing_eagerly
(
)
?
new
FuncGraph
(
"build_graph"
)
:
keras
.
backend
.
get_graph
(
)
;
graph
.
as_default
(
)
;
var
shapes
=
input_shape
.
ToShapeArray
(
)
;
var
x
=
new
Tensors
(
shapes
.
Select
(
x
=>
base_layer_utils
.
generate_placeholders_from_shape
(
x
)
)
.
ToArray
(
)
)
;
try
{
Call
(
x
,
training
:
false
)
;
}
catch
(
InvalidArgumentError
)
{
throw
new
ValueError
(
"You cannot build your model by calling `build` "
+
"if your layers do not support float type inputs. "
+
"Instead, in order to instantiate and build your "
+
"model, `call` your model on real tensor data (of the correct dtype)."
)
;
}
catch
(
TypeError
)
{
throw
new
ValueError
(
"You cannot build your model by calling `build` "
+
"if your layers do not support float type inputs. "
+
"Instead, in order to instantiate and build your "
+
"model, `call` your model on real tensor data (of the correct dtype)."
)
;
}
graph
.
Exit
(
)
;
}
base
.
build
(
input_shape
)
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL