Skip to content

Commit

Permalink
Adds default move constructors to tensorflow::XlaCompiledFunction.
Browse files Browse the repository at this point in the history
This class already deletes the copy constructors, but does not enable the move constructors. As written today, users of `tensorflow::XlaCompiledFunction` must wrap their instances in a `std::unique_ptr` (or similar) in order to move this instance. That solution would add indirection and proliferate null checks that is not needed after this chance.

PiperOrigin-RevId: 627474665
  • Loading branch information
tensorflower-gardener committed Apr 23, 2024
1 parent 2b46ab2 commit 308c605
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tensorflow/compiler/tf2xla/xla_compiled_cpu_function.h
Expand Up @@ -164,6 +164,8 @@ class XlaCompiledCpuFunction {

XlaCompiledCpuFunction(const XlaCompiledCpuFunction&) = delete;
XlaCompiledCpuFunction& operator=(const XlaCompiledCpuFunction&) = delete;
XlaCompiledCpuFunction(XlaCompiledCpuFunction&&) = default;
XlaCompiledCpuFunction& operator=(XlaCompiledCpuFunction&&) = default;

// Sets the intra-op thread pool used to run individual ops concurrently.
void set_thread_pool(const Eigen::ThreadPoolDevice* pool) {
Expand Down

0 comments on commit 308c605

Please sign in to comment.