提交 04e2c388 编写于 作者: R Ruilong Liu 提交者: GitHub

Merge pull request #879 from codeWorm2015/metal

 fix elewise add precision error
...@@ -45,7 +45,6 @@ protocol Net { ...@@ -45,7 +45,6 @@ protocol Net {
} }
extension Net { extension Net {
mutating func load() throws { mutating func load() throws {
let queue = MetalHelper.shared.queue let queue = MetalHelper.shared.queue
let loader = Loader<Float32>.init() let loader = Loader<Float32>.init()
......
...@@ -27,7 +27,7 @@ struct ElementwiseAddMetalParam { ...@@ -27,7 +27,7 @@ struct ElementwiseAddMetalParam {
class ElementwiseAddKernel<P: PrecisionType>: Kernel, Computable { class ElementwiseAddKernel<P: PrecisionType>: Kernel, Computable {
required init(device: MTLDevice, param: ElementwiseAddParam<P>) { required init(device: MTLDevice, param: ElementwiseAddParam<P>) {
super.init(device: device, inFunctionName: "elementwise_add") super.init(device: device, inFunctionName: "elementwise_add")
param.output.initTexture(device: device, inTranspose: param.inputX.transpose) param.output.initTexture(device: device, inTranspose: param.inputX.transpose, computePrecision: computePrecision)
} }
func compute(commandBuffer: MTLCommandBuffer, param: ElementwiseAddParam<P>) throws { func compute(commandBuffer: MTLCommandBuffer, param: ElementwiseAddParam<P>) throws {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册