Skip to content
This repository was archived by the owner on Jul 1, 2023. It is now read-only.

Commit cf50393

Browse files
Shashi456rxwei
authored andcommitted
Remove unnecessary calls to the TensorShape initializer (#249)
1 parent 290af7b commit cf50393

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Sources/TensorFlow/Layers/Convolutional.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public extension Conv1D where Scalar.RawSignificand: FixedWidthInteger {
9292
filterShape.0, filterShape.1, filterShape.2])
9393
self.init(
9494
filter: Tensor(glorotUniform: filterTensorShape),
95-
bias: Tensor(zeros: TensorShape([filterShape.2])),
95+
bias: Tensor(zeros: [filterShape.2]),
9696
activation: activation,
9797
stride: stride,
9898
padding: padding)
@@ -123,7 +123,7 @@ public extension Conv1D {
123123
filterShape.0, filterShape.1, filterShape.2])
124124
self.init(
125125
filter: Tensor(glorotUniform: filterTensorShape, seed: seed),
126-
bias: Tensor(zeros: TensorShape([filterShape.2])),
126+
bias: Tensor(zeros: [filterShape.2]),
127127
activation: activation,
128128
stride: stride,
129129
padding: padding)
@@ -208,7 +208,7 @@ public extension Conv2D {
208208
filterShape.0, filterShape.1, filterShape.2, filterShape.3])
209209
self.init(
210210
filter: Tensor(glorotUniform: filterTensorShape, generator: &generator),
211-
bias: Tensor(zeros: TensorShape([filterShape.3])),
211+
bias: Tensor(zeros: [filterShape.3]),
212212
activation: activation,
213213
strides: strides,
214214
padding: padding)
@@ -238,7 +238,7 @@ public extension Conv2D {
238238
filterShape.0, filterShape.1, filterShape.2, filterShape.3])
239239
self.init(
240240
filter: Tensor(glorotUniform: filterTensorShape, seed: seed),
241-
bias: Tensor(zeros: TensorShape([filterShape.3])),
241+
bias: Tensor(zeros: [filterShape.3]),
242242
activation: activation,
243243
strides: strides,
244244
padding: padding)
@@ -324,7 +324,7 @@ public extension Conv3D {
324324
filterShape.0, filterShape.1, filterShape.2, filterShape.3, filterShape.4])
325325
self.init(
326326
filter: Tensor(glorotUniform: filterTensorShape, generator: &generator),
327-
bias: Tensor(zeros: TensorShape([filterShape.4])),
327+
bias: Tensor(zeros: [filterShape.4]),
328328
activation: activation,
329329
strides: strides,
330330
padding: padding)
@@ -354,7 +354,7 @@ public extension Conv3D {
354354
filterShape.0, filterShape.1, filterShape.2, filterShape.3, filterShape.4])
355355
self.init(
356356
filter: Tensor(glorotUniform: filterTensorShape, seed: seed),
357-
bias: Tensor(zeros: TensorShape([filterShape.4])),
357+
bias: Tensor(zeros: [filterShape.4]),
358358
activation: activation,
359359
strides: strides,
360360
padding: padding)
@@ -449,7 +449,7 @@ public extension TransposedConv2D {
449449
filterShape.0, filterShape.1, filterShape.2, filterShape.3])
450450
self.init(
451451
filter: Tensor(glorotUniform: filterTensorShape, generator: &generator),
452-
bias: Tensor(zeros: TensorShape([filterShape.3])),
452+
bias: Tensor(zeros: [filterShape.3]),
453453
activation: activation,
454454
strides: strides,
455455
padding: padding)
@@ -479,7 +479,7 @@ public extension TransposedConv2D {
479479
filterShape.0, filterShape.1, filterShape.2, filterShape.3])
480480
self.init(
481481
filter: Tensor(glorotUniform: filterTensorShape, seed: seed),
482-
bias: Tensor(zeros: TensorShape([filterShape.3])),
482+
bias: Tensor(zeros: [filterShape.3]),
483483
activation: activation,
484484
strides: strides,
485485
padding: padding)

0 commit comments

Comments
 (0)