@@ -21,7 +21,7 @@ public class Layer : CheckpointableBase
2121 /// </summary>
2222 protected bool built ;
2323 protected bool trainable ;
24- protected TF_DataType _dtype ;
24+ public TF_DataType _dtype ;
2525 /// <summary>
2626 /// A stateful layer is a layer whose updates are run during inference too,
2727 /// for instance stateful RNNs.
@@ -33,12 +33,16 @@ public class Layer : CheckpointableBase
3333 protected InputSpec input_spec ;
3434 protected bool supports_masking ;
3535 protected List < RefVariable > _trainable_weights ;
36- protected string _name ;
36+ public string _name ;
3737 protected string _base_name ;
3838 protected bool _compute_previous_mask ;
3939 protected List < Operation > _updates ;
40+ public int [ ] _batch_input_shape ;
4041
41- public Layer ( bool trainable = true , string name = null , TF_DataType dtype = TF_DataType . DtInvalid )
42+ public Layer ( bool trainable = true ,
43+ string name = null ,
44+ TF_DataType dtype = TF_DataType . DtInvalid ,
45+ int [ ] input_shape = null )
4246 {
4347 this . trainable = trainable ;
4448 this . _dtype = dtype ;
@@ -49,6 +53,12 @@ public Layer(bool trainable = true, string name = null, TF_DataType dtype = TF_D
4953 _trainable_weights = new List < RefVariable > ( ) ;
5054 _compute_previous_mask = false ;
5155 _updates = new List < Operation > ( ) ;
56+
57+ // Manage input shape information if passed.
58+
59+ _batch_input_shape = new int [ ] { - 1 , - 1 } ;
60+
61+ _dtype = dtype ;
5262 }
5363
5464 public Tensor __call__ ( Tensor inputs ,
0 commit comments