diff --git a/metal/paddle-mobile/paddle-mobile/Src/Program/PMOpDesc.swift b/metal/paddle-mobile/paddle-mobile/Src/Program/PMOpDesc.swift index bc9a1abebd9dfe0c66edd2dfba1b8c1bd9310eed..663677150eb0f0240b032a713424aac8ed66c86a 100644 --- a/metal/paddle-mobile/paddle-mobile/Src/Program/PMOpDesc.swift +++ b/metal/paddle-mobile/paddle-mobile/Src/Program/PMOpDesc.swift @@ -27,7 +27,7 @@ class PMOpDesc { var map: [String : [String]] = [:] for opDescVar in vars { if (canAdd(opDescVar.parameter)) { - map[opDescVar.parameter] = opDescVar.argumentsArray as! [String] + map[opDescVar.parameter] = opDescVar.argumentsArray as? [String] } } return map diff --git a/metal/paddle-mobile/paddle-mobile/Src/Program/ProgramOptimize.swift b/metal/paddle-mobile/paddle-mobile/Src/Program/ProgramOptimize.swift index 0c41ca3f9d201293bc7552ccd73d9ce6d614e2b3..dcb065de3d8c6e7ec6cf437cbc2a19305def08ae 100644 --- a/metal/paddle-mobile/paddle-mobile/Src/Program/ProgramOptimize.swift +++ b/metal/paddle-mobile/paddle-mobile/Src/Program/ProgramOptimize.swift @@ -292,7 +292,7 @@ class ProgramOptimize { ops.append(node.opDesc!) } - var newProgramDesc = PMProgramDesc.init() + let newProgramDesc = PMProgramDesc.init() let newBlock = PMBlockDesc.init(inVars: block.vars, inOps: ops) newProgramDesc.blocks.append(newBlock) return newProgramDesc