mirror of
https://github.com/wassname/ray.git
synced 2026-07-29 11:26:04 +08:00
Added RAY_CHECK with line num and file name for logs
This commit is contained in:
@@ -3,9 +3,7 @@
|
||||
OperationId ComputationGraph::add_operation(std::unique_ptr<Operation> operation) {
|
||||
OperationId operationid = operations_.size();
|
||||
OperationId creator_operationid = operation->creator_operationid();
|
||||
if (spawned_operations_.size() != operationid) {
|
||||
RAY_LOG(RAY_FATAL, "ComputationGraph is attempting to call add_operation, but spawned_operations_.size() != operationid.");
|
||||
}
|
||||
RAY_CHECK_EQ(spawned_operations_.size(), operationid, "ComputationGraph is attempting to call add_operation, but spawned_operations_.size() != operationid.");
|
||||
operations_.emplace_back(std::move(operation));
|
||||
if (creator_operationid != NO_OPERATION && creator_operationid != ROOT_OPERATION) {
|
||||
spawned_operations_[creator_operationid].push_back(operationid);
|
||||
@@ -15,11 +13,7 @@ OperationId ComputationGraph::add_operation(std::unique_ptr<Operation> operation
|
||||
}
|
||||
|
||||
const Task& ComputationGraph::get_task(OperationId operationid) {
|
||||
if (operationid >= operations_.size()) {
|
||||
RAY_LOG(RAY_FATAL, "ComputationGraph attempting to get_task with operationid " << operationid << ", but operationid >= operations_.size().");
|
||||
}
|
||||
if (!operations_[operationid]->has_task()) {
|
||||
RAY_LOG(RAY_FATAL, "Calling get_task with operationid " << operationid << ", but this corresponds to a push not a task.");
|
||||
}
|
||||
RAY_CHECK_LT(operationid, operations_.size(), "ComputationGraph attempting to get_task with operationid " << operationid << ", but operationid >= operations_.size().");
|
||||
RAY_CHECK(operations_[operationid]->has_task(), "Calling get_task with operationid " << operationid << ", but this corresponds to a push not a task.");
|
||||
return operations_[operationid]->task();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user