-
Notifications
You must be signed in to change notification settings - Fork 1
/
inputs.py
46 lines (37 loc) · 1.4 KB
/
inputs.py
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
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
class Input(object):
"""A placeholder class for a tensor that be fed. Layer to be used as an entry point into a Network.
This class can create placeholders for Tensors
Args:
shape: int list, the shape of the tensor to be fed,
A shape tuple, not including the batch size.
depend_pls: the depend placeholder to take the last layer placeholder
input_layer: tensor, input tensor
Methods:
set_name:
set_tensor:
set_shape:
set_input_placeholder:
set_input_layer:
"""
def __init__(self, shape=None, depend_pls=None, input_layer=None):
# An optional name string for the layer.
self.id = None
self.tensor = None
# if shape is None and input_pl is None:
# raise ValueError('Provide the input shape and input placeholder')
self.shape = shape
self.depend_pls = depend_pls
self.input_layer = input_layer
def set_id(self, id):
self.id = id
def set_tensor(self, tensor):
self.tensor = tensor
def set_shape(self, shape):
self.shape = shape
def set_depend_pls(self, depend_pls):
self.depend_pls = depend_pls
def set_input_layer(self, input_layer):
self.input_layer = input_layer