提交 2e7cc48e 编写于 作者: J Justin Lebar 提交者: TensorFlower Gardener

Change for internal compatibility.

上级 25130ced
......@@ -41,7 +41,7 @@ SingleMachine::SingleMachine(int timeout_s, int num_cpu_cores, int num_gpus)
}
SingleMachine::~SingleMachine() {
CloseSession(false /*use_timeout*/);
CloseSession(false /*use_timeout*/).IgnoreError();
// Prevent the destructor from deleting mu_ until CloseSession() is done.
mutex_lock l(mu_);
......@@ -164,18 +164,18 @@ Status SingleMachine::CloseSession(bool use_timeout) {
thread_pool_->Schedule([this] {
if (this->coordinator_) {
this->coordinator_->RequestStop();
this->coordinator_->RequestStop().IgnoreError();
// Wait for all the runners to have closed their queues.
while (!this->coordinator_->AllRunnersStopped()) {
sleep(1);
}
// Now we can close the session. This should cancel any pending I/O
// operation.
this->session_->Close();
this->session_->Close().IgnoreError();
// Last but not least, we can delete the coordinator.
this->coordinator_.reset();
} else {
this->session_->Close();
this->session_->Close().IgnoreError();
}
// Wait for any previous run to finish.
......
......@@ -300,8 +300,9 @@ struct FusedBatchNorm<GPUDevice, T> {
GPUDevice d = context->eigen_device<GPUDevice>();
using perftools::gputools::DeviceMemory;
Tensor inv_var;
context->allocate_temp(DataTypeToEnum<T>::value, estimated_variance.shape(),
&inv_var);
OP_REQUIRES_OK(
context, context->allocate_temp(DataTypeToEnum<T>::value,
estimated_variance.shape(), &inv_var));
auto inv_var_ptr = StreamExecutorUtil::AsDeviceMemory<T>(inv_var);
std::function<const DeviceMemory<T>&()> var_to_inv_var =
[d, epsilon, estimated_variance,
......
......@@ -96,7 +96,8 @@ Status GraphTransferer::LoadGraphFromProto(
shape_inference::ShapeHandle handle;
status = context->MakeShapeFromTensorShape(
input_node_info.second.shape(), &handle);
shape_refiner.SetShape(node, 0, handle);
// TODO(b/32704451): Don't just ignore this status!
shape_refiner.SetShape(node, 0, handle).IgnoreError();
is_input_node = true;
}
if (!status.ok()) {
......@@ -395,9 +396,11 @@ void GraphTransferer::RegisterConstantNode(
const_node_info.add_shape(shape[2]);
const_node_info.add_shape(shape[3]);
const TensorProto* proto = nullptr;
GetNodeAttr(node.def(), "value", &proto);
// TODO(b/32704451): Don't just ignore this status!
GetNodeAttr(node.def(), "value", &proto).IgnoreError();
Tensor const_tensor;
MakeTensorFromProto(*proto, &const_tensor);
// TODO(b/32704451): Don't just ignore this status!
MakeTensorFromProto(*proto, &const_tensor).IgnoreError();
const_node_info.set_dtype(const_tensor.dtype());
// TODO(satok): Remove. Determine constant value without dryrun
......
......@@ -146,7 +146,7 @@ Status SparsifyGather(const GraphDef& input_graph_def,
const NodeDef& const_node = match.inputs[0].inputs[0].node;
DataType data_type;
GetNodeAttr(const_node, "dtype", &data_type);
TF_RETURN_IF_ERROR(GetNodeAttr(const_node, "dtype", &data_type));
if (data_type != DT_FLOAT) {
return tensorflow::errors::FailedPrecondition(
"Transform only applicable to subgraph with 'Const' of dtype "
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册