Skip to content

Commit e516195

Browse files
authored
Merge branch 'main' into shoumikhin-patch-1
2 parents 7a275ed + ba79cb6 commit e516195

File tree

1 file changed

+0
-24
lines changed

1 file changed

+0
-24
lines changed

extension/apple/ExecuTorch/__tests__/TensorTest.swift

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -172,30 +172,6 @@ class TensorTest: XCTestCase {
172172
}
173173
}
174174

175-
func testWithUnsafeBytesFloat16() throws {
176-
var data: [Float16] = [1, 2, 3, 4, 5, 6]
177-
let tensor = data.withUnsafeMutableBytes {
178-
Tensor(bytesNoCopy: $0.baseAddress!, shape: [6], dataType: .half)
179-
}
180-
let array: [Float16] = try tensor.withUnsafeBytes { Array($0) }
181-
XCTAssertEqual(array, data)
182-
}
183-
184-
func testWithUnsafeMutableBytesFloat16() throws {
185-
var data: [Float16] = [1, 2, 3, 4]
186-
let tensor = data.withUnsafeMutableBytes { buffer in
187-
Tensor(bytes: buffer.baseAddress!, shape: [4], dataType: .half)
188-
}
189-
try tensor.withUnsafeMutableBytes { (buffer: UnsafeMutableBufferPointer<Float16>) in
190-
for i in buffer.indices {
191-
buffer[i] *= 2
192-
}
193-
}
194-
try tensor.withUnsafeBytes { buffer in
195-
XCTAssertEqual(Array(buffer), data.map { $0 * 2 })
196-
}
197-
}
198-
199175
func testInitWithTensor() {
200176
var data: [Int] = [10, 20, 30, 40]
201177
let tensor1 = data.withUnsafeMutableBytes {

0 commit comments

Comments
 (0)