Skip to content

Commit

Permalink
Add downcast to MeshDevice
Browse files Browse the repository at this point in the history
  • Loading branch information
sminakov-tt committed Mar 1, 2025
1 parent e61f604 commit 3e20628
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ttnn/cpp/ttnn/tensor/tensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,11 @@ Tensor Tensor::to_device(distributed::MeshDevice* mesh_device, const MemoryConfi
}

Tensor Tensor::to_device(const std::vector<IDevice*>& workers, const MemoryConfig& mem_config, QueueId cq_id) const {
if (workers.size() == 1) {
if (auto mesh_device = dynamic_cast<distributed::MeshDevice*>(workers[0])) {
return to_device(mesh_device, mem_config, cq_id);
}
}
return tensor_ops::tensor_to_device(*this, workers, mem_config, cq_id);
}

Expand Down

0 comments on commit 3e20628

Please sign in to comment.