MPSMatrixDescriptor warning

When I try to run my matrix multiplication I receive the following warning in iOS but not in macOS : 'init(dimensions:columns:rowBytes:dataType:)' was deprecated in iOS 11.0

How may I change my code to remove the iOS warning? Here is my line generating the warning:

let mdesc = MPSMatrixDescriptor( dimensions: 2, columns: 2, rowBytes: rowbytes, dataType: MPSDataType.float16)

Accepted Reply

The convenience initializer:

init(dimensions rows: Int, columns: Int, rowBytes: Int, dataType: MPSDataType)  

...has been deprecated.

It looks like you should instead use:

init(rows: Int, columns: Int, rowBytes: Int, dataType: MPSDataType)

This seems to be the same, since the deprecated initializer replaces "dimensions" with "rows" anyway.

  • Thank you, robnotyou!

    I guess I can't read the documentation! Will try to learn how to read!

Add a Comment

Replies

The convenience initializer:

init(dimensions rows: Int, columns: Int, rowBytes: Int, dataType: MPSDataType)  

...has been deprecated.

It looks like you should instead use:

init(rows: Int, columns: Int, rowBytes: Int, dataType: MPSDataType)

This seems to be the same, since the deprecated initializer replaces "dimensions" with "rows" anyway.

  • Thank you, robnotyou!

    I guess I can't read the documentation! Will try to learn how to read!

Add a Comment