Skip to content
Merged
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
4 changes: 2 additions & 2 deletions extension/apple/ExecuTorch/Exported/ExecuTorch+Tensor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public extension Tensor {
func withUnsafeBytes<T: Scalar, R>(_ body: (UnsafeBufferPointer<T>) throws -> R) throws -> R {
guard dataType == T.dataType else { throw Error(code: .invalidArgument) }
var result: Result<R, Error>?
bytes { pointer, count, _ in
__bytes { pointer, count, _ in
result = Result { try body(
UnsafeBufferPointer(
start: pointer.assumingMemoryBound(to: T.self),
Expand All @@ -74,7 +74,7 @@ public extension Tensor {
func withUnsafeMutableBytes<T: Scalar, R>(_ body: (UnsafeMutableBufferPointer<T>) throws -> R) throws -> R {
guard dataType == T.dataType else { throw Error(code: .invalidArgument) }
var result: Result<R, Error>?
mutableBytes { pointer, count, _ in
__mutableBytes { pointer, count, _ in
result = Result { try body(
UnsafeMutableBufferPointer(
start: pointer.assumingMemoryBound(to: T.self),
Expand Down
4 changes: 2 additions & 2 deletions extension/apple/ExecuTorch/Exported/ExecuTorchTensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ __attribute__((deprecated("This API is experimental.")))
* - and the data type.
*/
- (void)bytesWithHandler:(NS_NOESCAPE void (^)(const void *pointer, NSInteger count, ExecuTorchDataType dataType))handler
NS_SWIFT_NAME(bytes(_:));
NS_REFINED_FOR_SWIFT;

/**
* Executes a block with a pointer to the tensor's mutable byte data.
Expand All @@ -187,7 +187,7 @@ __attribute__((deprecated("This API is experimental.")))
* - and the data type.
*/
- (void)mutableBytesWithHandler:(NS_NOESCAPE void (^)(void *pointer, NSInteger count, ExecuTorchDataType dataType))handler
NS_SWIFT_NAME(mutableBytes(_:));
NS_REFINED_FOR_SWIFT;

/**
* Resizes the tensor to a new shape.
Expand Down
Loading
Loading