Skip to content

Commit 2e0965e

Browse files
committed
MaterializedArray is a Sendable MLXArray
- once an array has been evaluated we can use it as Sendable - a subtype of MLXArray that is Sendable
1 parent dc43e62 commit 2e0965e

10 files changed

Lines changed: 1241 additions & 667 deletions

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version: 5.12
1+
// swift-tools-version: 6.2
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33
// Copyright © 2024 Apple Inc.
44

Source/MLX/MLXArray+Indexing.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,8 +388,7 @@ extension MLXArray {
388388
var result = mlx_array_new()
389389
mlx_scatter(
390390
&result, self.ctx, indices_vector, update.ctx, axes, axes.count, stream.ctx)
391-
mlx_array_set(&self.ctx, result)
392-
mlx_array_free(result)
391+
self._updateInternal(MLXArray(result))
393392
return
394393
} else {
395394
self._updateInternal(update)

0 commit comments

Comments
 (0)