Re:WWDC 2017 and What It Means for Developers
by shanev on Saturday June 17, 2017 @07:48AM
(#14575448)
Accelerate is a low level C framework that is not representative of all Apple APIs. It's only used directly for very specific use cases. Most of the time you'll be creating neural nets with CoreML which is built on Accelerate and has a much friendlier and higher level API.
Re:WWDC 2017 and What It Means for Developers
by aparadja on Saturday June 17, 2017 @07:53AM
(#14575475)
That function sure is ugly, but in general they have done a great job in making their own APIs more easy on the eyes.
And even that monstrosity doesn't look that bad in actual use:
let filter = BNNSFilterCreateConvolutionLayer(&inDesc, &outDesc, &layerParams, &filterParams)
The worst offenders for readability are these C-ish functions that deal with unsafe pointers. But at least in Swift, I appreciate the safety brought by the type checking. It's quite nice that unsafe code is clearly marked.
Re:WWDC 2017 and What It Means for Developers
by pjmlp on Saturday June 17, 2017 @09:40AM
(#14575850)
> The worst offenders for readability are these C-ish functions that deal with unsafe pointers.
That is exactly the point, to make it pretty clear that the code needs to be scrutinized very carefully for its safety.
func BNNSFilterCreateConvolutionLayer(UnsafePointer<BNNSImageStackDescriptor>, UnsafePointer<BNNSImageStackDescriptor>, UnsafePointer<BNNSConvolutionLayerParameters>, UnsafePointer<BNNSFilterParameters>?) Returns a convolution filter, initialized with input, output, layer, and filter parameters.