提交 66fd854f 编写于 作者: L liuruilong

commit for test

上级 749dbc93
...@@ -50,11 +50,11 @@ public class SuperResolutionNet: Net{ ...@@ -50,11 +50,11 @@ public class SuperResolutionNet: Net{
texture.updateDims(inTensorDim: Dim.init(inDim: [texture.tensorDim[0], texture.tensorDim[1], inputDim[1], inputDim[2]]), inDim: newDim) texture.updateDims(inTensorDim: Dim.init(inDim: [texture.tensorDim[0], texture.tensorDim[1], inputDim[1], inputDim[2]]), inDim: newDim)
texture.initTexture(device: device, inTranspose: [0, 1, 2, 3], computePrecision: computePrecision) texture.initTexture(device: device, inTranspose: [0, 1, 2, 3], computePrecision: computePrecision)
let output: FetchHolder = program.scope.output() as! FetchHolder // let output: FetchHolder = program.scope.output() as! FetchHolder
output.dim = newDim // output.dim = newDim
output.capacity = newDim.numel() // output.capacity = newDim.numel()
output.paddedCapacity = newDim.numel() * 4 // output.paddedCapacity = newDim.numel() * 4
output.initBuffer(device: device) // output.initBuffer(device: device)
} }
} }
} }
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import Foundation import Foundation
let testTo = 22 let testTo = 2
var isTest = false var isTest = false
...@@ -81,7 +81,7 @@ public class Executor<P: PrecisionType> { ...@@ -81,7 +81,7 @@ public class Executor<P: PrecisionType> {
for block in inProgram.programDesc.blocks { for block in inProgram.programDesc.blocks {
//block.ops.count //block.ops.count
for i in 0..<block.ops.count { for i in 0..<testTo {
let opDesc = block.ops[i] let opDesc = block.ops[i]
do { do {
...@@ -125,7 +125,7 @@ public class Executor<P: PrecisionType> { ...@@ -125,7 +125,7 @@ public class Executor<P: PrecisionType> {
let inputTexture = InputTexture.init(inMTLTexture: resInput, inExpectDim: dim) let inputTexture = InputTexture.init(inMTLTexture: resInput, inExpectDim: dim)
program.scope.setInput(input: inputTexture) program.scope.setInput(input: inputTexture)
//(ops.count - except) //(ops.count - except)
for i in 0..<(ops.count - except) { for i in 0..<(testTo - except) {
let op = ops[i] let op = ops[i]
do { do {
try op.run(device: device, buffer: buffer) try op.run(device: device, buffer: buffer)
...@@ -161,6 +161,7 @@ public class Executor<P: PrecisionType> { ...@@ -161,6 +161,7 @@ public class Executor<P: PrecisionType> {
for op in SSelf.ops { for op in SSelf.ops {
op.delogOutput() op.delogOutput()
} }
return
var resultHolder: GPUResultHolder var resultHolder: GPUResultHolder
if except > 0 { if except > 0 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册