Skip to content

Commit c506322

Browse files
Ryu-gaRyu-ga
andauthored
Update Decoder.swift (#249)
* Update Decoder.swift * Update Encoder.swift --------- Co-authored-by: Ryu-ga <[email protected]>
1 parent a56e102 commit c506322

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

swift/StableDiffusion/pipeline/Decoder.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public struct Decoder: ResourceManaging {
6464
let result = results.features(at: i)
6565
let outputName = result.featureNames.first!
6666
let output = result.featureValue(for: outputName)!.multiArrayValue!
67-
return try CGImage.fromShapedArray(MLShapedArray<Float32>(output))
67+
return try CGImage.fromShapedArray(MLShapedArray<Float32>(converting: output))
6868
}
6969

7070
return images

swift/StableDiffusion/pipeline/Encoder.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public struct Encoder: ResourceManaging {
6363
}
6464
let outputName = result.featureNames.first!
6565
let outputValue = result.featureValue(for: outputName)!.multiArrayValue!
66-
let output = MLShapedArray<Float32>(outputValue)
66+
let output = MLShapedArray<Float32>(converting: outputValue)
6767

6868
// DiagonalGaussianDistribution
6969
let mean = output[0][0..<4]

0 commit comments

Comments
 (0)