Skip to content

Commit a6b70f5

Browse files
cezhengtensorflower-gardener
authored andcommitted
[PJRT] Add a method to PjRtClient to create an error buffer without allocating memory.
PiperOrigin-RevId: 503264732
1 parent eba61a3 commit a6b70f5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tensorflow/compiler/xla/pjrt/pjrt_client.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,12 @@ class PjRtClient {
505505
virtual StatusOr<std::unique_ptr<PjRtBuffer>> CreateUninitializedBuffer(
506506
const Shape& shape, PjRtDevice* device) = 0;
507507

508+
// Creates buffer that carries an error future without allocating memory.
509+
virtual StatusOr<std::unique_ptr<PjRtBuffer>> CreateErrorBuffer(
510+
Status error, const Shape& shape, PjRtDevice* device) {
511+
return Unimplemented("CreateErrorBuffer not supported.");
512+
}
513+
508514
// A client may want to create a buffer, and hand the buffer to other PjRt
509515
// methods, before the data to store in the buffer is available to the client.
510516
// This is supported using CreateBuffersForAsyncHostToDevice, which returns an

0 commit comments

Comments
 (0)