@@ -32,3 +32,27 @@ function run(graph::MPSGraph, commandQueue::MTLCommandQueue, feeds::MPSGraphTens
3232                                         targetOperations: nil:: id{Object} ]:: id{MPSGraphTensorDataDictionary} 
3333    MPSGraphTensorDataDictionary (obj)
3434end 
35+ 
36+ const  MPSGraphTensorShapedTypeDictionary =  NSDictionary# {MPSGraphTensor, MPSGraphTensorShapedType}
37+ 
38+ compile (graph:: MPSGraph , dev:: MTLDevice , feeds:: MPSGraphTensorShapedTypeDictionary , targetTensors:: NSArray , targetOperations= nil, compilationDescriptor= nil) =  compile (graph, MPSGraphDevice (dev), feeds, targetTensors, targetOperations, compilationDescriptor)
39+ function  compile (graph:: MPSGraph , dev:: MPSGraphDevice , feeds:: MPSGraphTensorShapedTypeDictionary , targetTensors:: NSArray , targetOperations= nil, compilationDescriptor= nil)
40+     exec =  @objc  [graph:: id{MPSGraph}  compileWithDevice: dev:: id{MPSGraphDevice} 
41+                                      feeds: feeds:: id{MPSGraphTensorShapedTypeDictionary} 
42+                              targetTensors: targetTensors:: id{NSArray} 
43+                           targetOperations: targetOperations:: id{Object} 
44+                      compilationDescriptor: compilationDescriptor:: id{Object} ]:: id{MPSGraphExecutable} 
45+     return  MPSGraphExecutable (exec)
46+ end 
47+ 
48+ function  MPSGraphExecutableSerializationDescriptor ()
49+     tmp =  @objc  [MPSGraphExecutableSerializationDescriptor alloc]:: id{MPSGraphExecutableSerializationDescriptor} 
50+     obj =  MPSGraphExecutableSerializationDescriptor (tmp)
51+     return  obj
52+ end 
53+ 
54+ serialize (graphExe:: MPSGraphExecutable , url, descriptor= MPSGraphExecutableSerializationDescriptor ()) =  serialize (graphExe, NSFileURL (url), descriptor)
55+ function  serialize (graphExe:: MPSGraphExecutable , url:: NSURL , descriptor= MPSGraphExecutableSerializationDescriptor ())
56+     @objc  [graphExe:: id{MPSGraphExecutable}  serializeToMPSGraphPackageAtURL: url:: id{NSURL} 
57+                               descriptor: descriptor:: id{MPSGraphExecutableSerializationDescriptor} ]:: Nothing 
58+ end 
0 commit comments