From 88d033edfa3e524144d534cd445d5da905aaa98a Mon Sep 17 00:00:00 2001 From: dolphin8 Date: Fri, 24 Aug 2018 19:59:46 +0800 Subject: [PATCH] fix --- .../paddle-mobile/Operators/Kernels/SoftmaxKernel.swift | 1 + .../paddle-mobile/Operators/Kernels/TransposeKernel.swift | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/metal/paddle-mobile/paddle-mobile/Operators/Kernels/SoftmaxKernel.swift b/metal/paddle-mobile/paddle-mobile/Operators/Kernels/SoftmaxKernel.swift index b94f0286f4..ec7d7134a7 100644 --- a/metal/paddle-mobile/paddle-mobile/Operators/Kernels/SoftmaxKernel.swift +++ b/metal/paddle-mobile/paddle-mobile/Operators/Kernels/SoftmaxKernel.swift @@ -27,6 +27,7 @@ class SoftmaxKernel: Kernel, Computable{ } required init(device: MTLDevice, param: SoftmaxParam

) { + param.output.initTexture(device: device) super.init(device: device, inFunctionName: "softmax") } } diff --git a/metal/paddle-mobile/paddle-mobile/Operators/Kernels/TransposeKernel.swift b/metal/paddle-mobile/paddle-mobile/Operators/Kernels/TransposeKernel.swift index 8d7fee1c6e..dd0577c878 100644 --- a/metal/paddle-mobile/paddle-mobile/Operators/Kernels/TransposeKernel.swift +++ b/metal/paddle-mobile/paddle-mobile/Operators/Kernels/TransposeKernel.swift @@ -49,7 +49,11 @@ class TransposeKernel: Kernel, Computable, Testable { for (i, v) in param.input.transpose.enumerated() { invT[v] = i } - let realAxis = param.axis.map {invT[$0]} + var axis: [Int] = [0, 1, 2, 3] + for i in 0..