Skip to content

Commit c0bf8d2

Browse files
lingbai-kongOceania2018
authored andcommitted
fix: can't implement len for KerasShapesWrapper & Add bias implement to Conv2DTranspose.Call()
1 parent 7d7f4e1 commit c0bf8d2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/TensorFlowNET.Keras/Layers/Convolution/Conv2DTranspose.cs

+5-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ private static Conv2DArgs InitializeUndefinedArgs(Conv2DArgs args)
6262
public override void build(KerasShapesWrapper input_shape)
6363
{
6464
var single_shape = input_shape.ToSingleShape();
65-
if (len(input_shape) != 4)
65+
if (len(single_shape) != 4)
6666
throw new ValueError($"Inputs should have rank 4. Received input shape: {input_shape}");
6767

6868
var channel_axis = _get_channel_axis();
@@ -138,7 +138,10 @@ protected override Tensors Call(Tensors inputs, Tensor state = null, bool? train
138138
}
139139

140140
if (use_bias)
141-
throw new NotImplementedException("");
141+
tf.nn.bias_add(
142+
outputs,
143+
bias,
144+
data_format: conv_utils.convert_data_format(data_format, ndim: 4));
142145

143146
if (activation != null)
144147
return activation.Apply(outputs);

0 commit comments

Comments
 (0)