Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CoreML] Update to Xcode 9 Beta 4 #2387

Merged
merged 3 commits into from
Aug 1, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 56 additions & 5 deletions src/coreml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public enum MLFeatureType : nint {
String = 3,
Image = 4,
MultiArray = 5,
Dictionary = 6
Dictionary = 6,
}

[Watch (4,0), TV (11,0), Mac (10,13, onlyOn64: true), iOS (11,0)]
Expand All @@ -38,16 +38,15 @@ public enum MLFeatureType : nint {
public enum MLModelError : nint {
Generic = 0,
FeatureType = 1,
DescriptionMismatch = 2,
Io = 3
IO = 3,
}

[Watch (4,0), TV (11,0), Mac (10,13, onlyOn64: true), iOS (11,0)]
[Native]
public enum MLMultiArrayDataType : nint {
Double = 65536 | 64,
Float32 = 65536 | 32,
Int32 = 131072 | 32
Int32 = 131072 | 32,
}

[Watch (4,0), TV (11,0), Mac (10,13, onlyOn64: true), iOS (11,0)]
Expand Down Expand Up @@ -166,11 +165,22 @@ interface MLModel {
[Static]
[Export ("modelWithContentsOfURL:error:")]
[return: NullAllowed]
MLModel FromUrl (NSUrl url, [NullAllowed] out NSError error);
MLModel FromUrl (NSUrl url, out NSError error);

[Export ("predictionFromFeatures:error:")]
[return: NullAllowed]
IMLFeatureProvider GetPrediction (IMLFeatureProvider input, out NSError error);

[Export ("predictionFromFeatures:options:error:")]
[return: NullAllowed]
IMLFeatureProvider GetPrediction (IMLFeatureProvider input, MLPredictionOptions options, out NSError error);

// Category MLModel (MLModelCompilation)

[Static]
[Export ("compileModelAtURL:error:")]
[return: NullAllowed]
NSUrl CompileModel (NSUrl modelUrl, out NSError error);
}

[Watch (4,0), TV (11,0), Mac (10,13, onlyOn64: true), iOS (11,0)]
Expand Down Expand Up @@ -266,5 +276,46 @@ interface MLMultiArray {
[Export ("setObject:forKeyedSubscript:")]
void SetObject (NSNumber obj, NSNumber [] key);
}

[Watch (4,0), TV (11,0), Mac (10,13, onlyOn64: true), iOS (11,0)]
[BaseType (typeof (NSObject))]
interface MLDictionaryConstraint {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see this type exposed anywhere in the PR !?! but it's used as a property in the diff. Something is missing ?


[Export ("keyType")]
MLFeatureType KeyType { get; }
}

[Watch (4,0), TV (11,0), Mac (10,13, onlyOn64: true), iOS (11,0)]
[BaseType (typeof (NSObject))]
interface MLImageConstraint {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same


[Export ("pixelsHigh")]
nint PixelsHigh { get; }

[Export ("pixelsWide")]
nint PixelsWide { get; }

[Export ("pixelFormatType")]
uint PixelFormatType { get; }
}

[Watch (4,0), TV (11,0), Mac (10,13, onlyOn64: true), iOS (11,0)]
[BaseType (typeof (NSObject))]
interface MLMultiArrayConstraint {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same


[Export ("shape")]
NSNumber [] Shape { get; }

[Export ("dataType")]
MLMultiArrayDataType DataType { get; }
}

[Watch (4,0), TV (11,0), Mac (10,13, onlyOn64: true), iOS (11,0)]
[BaseType (typeof (NSObject))]
interface MLPredictionOptions {

[Export ("usesCPUOnly")]
bool UsesCpuOnly { get; set; }
}
}
#endif // XAMCORE_2_0
4 changes: 4 additions & 0 deletions tests/introspection/ApiProtocolTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ protected virtual bool Skip (Type type, string protocolName)
case "GKCloudPlayer":
// iOS 10 : test throw because of generic usage
case "NSMeasurement`1":
// Xcode 9 - Conformance not in heades
case "MLDictionaryConstraint":
case "MLImageConstraint":
case "MLMultiArrayConstraint":
return true; // skip
}
break;
Expand Down