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

Commit 1485f8b

Browse files
committed
Updating seed to int32 and some errors
1 parent 135cfaa commit 1485f8b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Sources/TensorFlow/Layers/Convolutional.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ public struct TransposedConv1D: Layer {
413413
public func callAsFunction(_ input: Tensor<Float>) -> Tensor<Float> {
414414
let batchSize = input.shape[0]
415415
let w = (input.shape[1] - (1 * paddingIndex)) *
416-
strides.0 + (filter.shape[0] * paddingIndex)
416+
strides + (filter.shape[0] * paddingIndex)
417417
let c = filter.shape[2]
418418
let newShape = Tensor<Int32>([Int32(batchSize), Int32(w), Int32(c), 1])
419419
return activation(conv2DBackpropInput(input.expandingShape(at: 1), shape: newShape,
@@ -471,8 +471,8 @@ public extension TransposedConv1D {
471471
strides: Int = 1,
472472
padding: Padding = .valid,
473473
activation: @escaping Activation = identity,
474-
seed: (Int64, Int64) = (Int64.random(in: Int64.min..<Int64.max),
475-
Int64.random(in: Int64.min..<Int64.max))
474+
seed: (Int32, Int32) = (Int32.random(in: Int32.min..<Int32.max),
475+
Int32.random(in: Int32.min..<Int32.max))
476476
) {
477477
let filterTensorShape = TensorShape([
478478
filterShape.0, filterShape.1, filterShape.2])
@@ -723,8 +723,8 @@ public extension TransposedConv3D {
723723
strides: (Int, Int, Int) = (1, 1, 1),
724724
padding: Padding = .valid,
725725
activation: @escaping Activation = identity,
726-
seed: (Int64, Int64) = (Int64.random(in: Int64.min..<Int64.max),
727-
Int64.random(in: Int64.min..<Int64.max))
726+
seed: (Int32, Int32) = (Int32.random(in: Int32.min..<Int32.max),
727+
Int32.random(in: Int32.min..<Int32.max))
728728
) {
729729
let filterTensorShape = TensorShape([
730730
filterShape.0, filterShape.1, filterShape.2, filterShape.3, filterShape.4])

0 commit comments

Comments
 (0)