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

Remove unnecessary calls to the TensorShape initializer #249

Merged
merged 1 commit into from
Jun 16, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions Sources/TensorFlow/Layers/Convolutional.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public extension Conv1D where Scalar.RawSignificand: FixedWidthInteger {
filterShape.0, filterShape.1, filterShape.2])
self.init(
filter: Tensor(glorotUniform: filterTensorShape),
bias: Tensor(zeros: TensorShape([filterShape.2])),
bias: Tensor(zeros: [filterShape.2]),
activation: activation,
stride: stride,
padding: padding)
Expand Down Expand Up @@ -123,7 +123,7 @@ public extension Conv1D {
filterShape.0, filterShape.1, filterShape.2])
self.init(
filter: Tensor(glorotUniform: filterTensorShape, seed: seed),
bias: Tensor(zeros: TensorShape([filterShape.2])),
bias: Tensor(zeros: [filterShape.2]),
activation: activation,
stride: stride,
padding: padding)
Expand Down Expand Up @@ -208,7 +208,7 @@ public extension Conv2D {
filterShape.0, filterShape.1, filterShape.2, filterShape.3])
self.init(
filter: Tensor(glorotUniform: filterTensorShape, generator: &generator),
bias: Tensor(zeros: TensorShape([filterShape.3])),
bias: Tensor(zeros: [filterShape.3]),
activation: activation,
strides: strides,
padding: padding)
Expand Down Expand Up @@ -238,7 +238,7 @@ public extension Conv2D {
filterShape.0, filterShape.1, filterShape.2, filterShape.3])
self.init(
filter: Tensor(glorotUniform: filterTensorShape, seed: seed),
bias: Tensor(zeros: TensorShape([filterShape.3])),
bias: Tensor(zeros: [filterShape.3]),
activation: activation,
strides: strides,
padding: padding)
Expand Down Expand Up @@ -324,7 +324,7 @@ public extension Conv3D {
filterShape.0, filterShape.1, filterShape.2, filterShape.3, filterShape.4])
self.init(
filter: Tensor(glorotUniform: filterTensorShape, generator: &generator),
bias: Tensor(zeros: TensorShape([filterShape.4])),
bias: Tensor(zeros: [filterShape.4]),
activation: activation,
strides: strides,
padding: padding)
Expand Down Expand Up @@ -354,7 +354,7 @@ public extension Conv3D {
filterShape.0, filterShape.1, filterShape.2, filterShape.3, filterShape.4])
self.init(
filter: Tensor(glorotUniform: filterTensorShape, seed: seed),
bias: Tensor(zeros: TensorShape([filterShape.4])),
bias: Tensor(zeros: [filterShape.4]),
activation: activation,
strides: strides,
padding: padding)
Expand Down Expand Up @@ -449,7 +449,7 @@ public extension TransposedConv2D {
filterShape.0, filterShape.1, filterShape.2, filterShape.3])
self.init(
filter: Tensor(glorotUniform: filterTensorShape, generator: &generator),
bias: Tensor(zeros: TensorShape([filterShape.3])),
bias: Tensor(zeros: [filterShape.3]),
activation: activation,
strides: strides,
padding: padding)
Expand Down Expand Up @@ -479,7 +479,7 @@ public extension TransposedConv2D {
filterShape.0, filterShape.1, filterShape.2, filterShape.3])
self.init(
filter: Tensor(glorotUniform: filterTensorShape, seed: seed),
bias: Tensor(zeros: TensorShape([filterShape.3])),
bias: Tensor(zeros: [filterShape.3]),
activation: activation,
strides: strides,
padding: padding)
Expand Down