Skip to content

Commit

Permalink
Fix calling Literal member functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
yifeif committed Jun 21, 2017
1 parent 15a8df7 commit e89f04d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tensorflow/compiler/plugin/executor/executable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ static se::DeviceMemoryBase AllocateSingleOutput(sep::ExecutorExecutor* executor
const Literal& literal) {
int64 size(xla::ShapeUtil::ByteSizeOf(literal.shape()));
void* buf = executor->Allocate(size);
const void* src = Literal::InternalData(literal);
const void* src = literal.InternalData();
memcpy(buf, src, size);
return se::DeviceMemoryBase(buf, size);
}
Expand Down Expand Up @@ -90,7 +90,7 @@ StatusOr<se::DeviceMemoryBase> ExecutorExecutable::ExecuteOnStream(
arg_literals_ptrs.push_back(arg_literals.back().get());

// Copy in the data from the stream_executor buffers
void* buffer = Literal::MutableInternalData(arg_literals.back().get());
void* buffer = arg_literals.back().get()->MutableInternalData();
memcpy(buffer, arguments[p].opaque(),
ShapeUtil::ByteSizeOf(param->shape()));
}
Expand Down
8 changes: 4 additions & 4 deletions tensorflow/compiler/plugin/executor/transfer_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ Status ExecutorTransferManager::TransferLiteralFromDevice(
}

*literal->mutable_shape() = device_shape;
Literal::Reserve(ShapeUtil::ElementsIn(device_shape), literal);
literal->Reserve(ShapeUtil::ElementsIn(device_shape));
TF_RETURN_IF_ERROR(TransferBufferFromDevice(
executor, source, ShapeUtil::ByteSizeOf(device_shape),
Literal::MutableInternalData(literal)));
literal->MutableInternalData()));
if (!ShapeUtil::Equal(literal_shape, device_shape)) {
literal->Swap(
Literal::Relayout(*literal, literal_shape.layout()).get());
literal->Relayout(literal_shape.layout()).get());
}
TF_RET_CHECK(ShapeUtil::Equal(literal_shape, literal->shape()));
return Status::OK();
Expand Down Expand Up @@ -134,7 +134,7 @@ Status ExecutorTransferManager::TransferLiteralToDevice(
}

return TransferBufferToDevice(executor, GetByteSizeRequirement(shape),
Literal::InternalData(literal),
literal.InternalData(),
destination);
}

Expand Down

0 comments on commit e89f04d

Please sign in to comment.