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

Add collect function #28

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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: 2 additions & 0 deletions src/xrt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ struct XRTArray{T, Dims, N} <: AbstractArray{T, N}
end
end

Base.collect(xs::XRTArray) = xs.storage.localstorage
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be convert(Array, xs) to make sure to get the data from the remote if not present.


function read_literal(rs::XRTAllocation)
sess, dev, h = rs.sess, rs.device, rs.h
op() = as_default(tf_graph(sess)) do
Expand Down