From 44d64105727e57621308cf805851c73b8b23db0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Wed, 28 Aug 2024 00:07:16 +0200 Subject: [PATCH] Bring variable assignment back --- exla/lib/exla/defn/buffers.ex | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/exla/lib/exla/defn/buffers.ex b/exla/lib/exla/defn/buffers.ex index c5908b876bf..b73c54742dc 100644 --- a/exla/lib/exla/defn/buffers.ex +++ b/exla/lib/exla/defn/buffers.ex @@ -109,12 +109,13 @@ defmodule EXLA.Defn.Buffers do case data do %EXLA.Backend{buffer: %EXLA.DeviceBuffer{ref: ref} = buffer} when node(ref) != node() -> - try do - :erpc.call(node(ref), EXLA.DeviceBuffer, :read, [buffer]) - catch - :error, {:exception, reason, stacktrace} -> - reraise Exception.normalize(:error, reason, stacktrace), stacktrace - end + binary = + try do + :erpc.call(node(ref), EXLA.DeviceBuffer, :read, [buffer]) + catch + :error, {:exception, reason, stacktrace} -> + reraise Exception.normalize(:error, reason, stacktrace), stacktrace + end EXLA.BinaryBuffer.from_binary(binary, to_typespec(tensor))