Skip to content

Commit

Permalink
Test unsafe_convert on Tensor
Browse files Browse the repository at this point in the history
  • Loading branch information
mofeing committed Jun 11, 2024
1 parent 15bdfcd commit da8a278
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/Tensor_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@
@test stride(tensor, 3) == stride(tensor, :k) == 4
end

@testset "unsafe_convert" begin
tensor = Tensor(zeros(2, 2, 2), (:i, :j, :k))
@test unsafe_convert(Ptr{Float64}, tensor) == unsafe_convert(Ptr{Float64}, parent(tensor))
end

@testset "Base.replace" begin
tensor = Tensor(zeros(2, 2, 2), (:i, :j, :k))
@test inds(replace(tensor, :i => :u, :j => :v, :k => :w)) == [:u, :v, :w]
Expand Down

0 comments on commit da8a278

Please sign in to comment.