From 0fa32efc292818d3c3862d1e5d8f585099281640 Mon Sep 17 00:00:00 2001 From: Mike Innes Date: Fri, 14 Dec 2018 06:33:18 +0000 Subject: [PATCH 1/2] collect --- src/xrt.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/xrt.jl b/src/xrt.jl index d2cef21..ae7c379 100644 --- a/src/xrt.jl +++ b/src/xrt.jl @@ -240,6 +240,8 @@ struct XRTArray{T, Dims, N} <: AbstractArray{T, N} end end +Base.collect(xs::XRTArray) = xs.storage.localstorage + function read_literal(rs::XRTAllocation) sess, dev, h = rs.sess, rs.device, rs.h op() = as_default(tf_graph(sess)) do From 9699f0705c68529bd9e29afca6d9f7c23f943d12 Mon Sep 17 00:00:00 2001 From: Mike J Innes Date: Thu, 10 Jan 2019 11:37:02 +0000 Subject: [PATCH 2/2] Update xrt.jl --- src/xrt.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xrt.jl b/src/xrt.jl index ae7c379..0e097fa 100644 --- a/src/xrt.jl +++ b/src/xrt.jl @@ -240,7 +240,7 @@ struct XRTArray{T, Dims, N} <: AbstractArray{T, N} end end -Base.collect(xs::XRTArray) = xs.storage.localstorage +Base.collect(xs::XRTArray) = convert(Array, xs) function read_literal(rs::XRTAllocation) sess, dev, h = rs.sess, rs.device, rs.h