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

Commit 23c16ae

Browse files
authored
[TF] Change APIs to use Int instead of Int32. (#84)
Friend PR: swiftlang/swift#24012
1 parent 01e7b6e commit 23c16ae

File tree

3 files changed

+102
-104
lines changed

3 files changed

+102
-104
lines changed

Sources/DeepLearning/Initializers.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public extension Tensor where Scalar: BinaryFloatingPoint {
6161
Int64.random(in: Int64.min..<Int64.max))
6262
) {
6363
self = Raw.statelessRandomUniform(
64-
shape: Tensor<Int32>((0..<shape.rank).map{shape[$0]}),
64+
shape: Tensor<Int32>((0..<shape.rank).map { Int32(shape[$0]) }),
6565
seed: Tensor<Int64>([seed.0, seed.1])
6666
)
6767
}
@@ -79,7 +79,7 @@ public extension Tensor where Scalar: BinaryFloatingPoint {
7979
Int64.random(in: Int64.min..<Int64.max))
8080
) {
8181
self = Raw.statelessRandomNormal(
82-
shape: Tensor<Int32>((0..<shape.rank).map{shape[$0]}),
82+
shape: Tensor<Int32>((0..<shape.rank).map { Int32(shape[$0]) }),
8383
seed: Tensor<Int64>([seed.0, seed.1])
8484
)
8585
}

0 commit comments

Comments
 (0)