Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Updates to MLCompute interface to use correct API. #3338

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion src/ml/neural_net/mlc_dc_backend.mm
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ mlc_layer_weights import_weights(const float_array_map &weights)
// Instantiate training graph.
MLCGraph *graph = [MLCGraph tc_graphForDrawingClassifierDescriptor:descriptor
batchSize:batch_size];
training_graph_ = [MLCTrainingGraph trainingGraphWithGraphObjects:@[ graph ]
training_graph_ = [MLCTrainingGraph graphWithGraphObjects:@[ graph ]
lossLayer:loss
optimizer:optimizer];

Expand Down
2 changes: 1 addition & 1 deletion src/ml/neural_net/mlc_layer_weights.mm
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
MLCTensorData *optimizerData1 = copy_float_array(optimizer_data_1_key, optimizer_data_1);
MLCTensorData *optimizerData2 = copy_float_array(optimizer_data_2_key, optimizer_data_2);
if (tensors_[layerName] != nil) {
BOOL success = [tensors_[layerName] optimizerData:@[ optimizerData1, optimizerData2 ]];
BOOL success = [tensors_[layerName] bindOptimizerData:@[ optimizerData1, optimizerData2] deviceData:nil];
if (!success) {
throw("Failed to load optimizer data into tensor");
}
Expand Down
4 changes: 2 additions & 2 deletions src/ml/neural_net/mlc_od_backend.mm
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,10 @@ mlc_layer_weights import_weights(const float_array_map &weights)
MLCSGDOptimizer *optimizer =
[MLCSGDOptimizer optimizerWithDescriptor:create_optimizer_descriptor(config)
momentumScale:0.9f
usesNestrovMomentum:NO];
usesNesterovMomentum:NO];

// Instantiate training graph.
result.trainingGraph = [MLCTrainingGraph trainingGraphWithGraphObjects:@[ graph ]
result.trainingGraph = [MLCTrainingGraph graphWithGraphObjects:@[ graph ]
lossLayer:lossLayer
optimizer:optimizer];

Expand Down