diff --git a/metal/paddle-mobile-demo/paddle-mobile-demo/Net/Genet.swift b/metal/paddle-mobile-demo/paddle-mobile-demo/Net/Genet.swift index 0ba8c2f293d5b3e91d15effaf199acac99c29537..daccf165b7e78f63f052d58c9abc149f43837611 100644 --- a/metal/paddle-mobile-demo/paddle-mobile-demo/Net/Genet.swift +++ b/metal/paddle-mobile-demo/paddle-mobile-demo/Net/Genet.swift @@ -31,7 +31,7 @@ class Genet: Net { } func resultStr(res: [Float]) -> String { - return " 哈哈 还没好 genet !"; + return " \(res) " } var preprocessKernel: CusomKernel diff --git a/metal/paddle-mobile-demo/paddle-mobile-demo/ViewController.swift b/metal/paddle-mobile-demo/paddle-mobile-demo/ViewController.swift index ecffd6af6d86b37492c0718acab77a712b9a8f33..40129d1b1455c9e0300e13ee4a3c2523e91bee45 100644 --- a/metal/paddle-mobile-demo/paddle-mobile-demo/ViewController.swift +++ b/metal/paddle-mobile-demo/paddle-mobile-demo/ViewController.swift @@ -79,7 +79,7 @@ class ViewController: UIViewController { return } do { - let max = 1 + let max = 50 let startDate = Date.init() for i in 0.. { // print(stridableInput) // let _: Flo? = input.logDesc(header: "input: ", stridable: true) - for i in 0..: Kernel, Computable{ N: Int32(param.input.tensorDim[0]), K: Int32(param.input.tensorDim[1]) ) - - print(" soft max param: ") - print(smp) + encoder.setBytes(&smp, length: MemoryLayout.size, index: 0) encoder.dispatch(computePipline: pipline, outTexture: param.output.metalTexture) encoder.endEncoding() diff --git a/metal/paddle-mobile/paddle-mobile/framework/Texture.swift b/metal/paddle-mobile/paddle-mobile/framework/Texture.swift index d3beb92a5fa30dfae5ddbbcd8bb7563b791771e4..c6e8842182116001ceaa89510389cca29f1f7d7e 100644 --- a/metal/paddle-mobile/paddle-mobile/framework/Texture.swift +++ b/metal/paddle-mobile/paddle-mobile/framework/Texture.swift @@ -50,7 +50,7 @@ public class Texture: Tensorial { guard padToFourDim.cout() == 4 else { fatalError("- not support -") } - return metalTexture.toTensor(dim: (n: padToFourDim[0], c: padToFourDim[1], h: padToFourDim[2], w: padToFourDim[3])) + return metalTexture.toTensor(dim: (n: dim[0], c: dim[3], h: dim[1], w: dim[2])) } func realNHWC() -> [Float32] {