Return if an error status was set in LinearAlgebraOp::AnalyzeInput() or LinearAlgebraOp::PrepareOutputs(), instead of potentially crashing.
PiperOrigin-RevId: 279834647 Change-Id: Iaef1b3598eaee212c75e397f4ffafce0ebfdf8b8
This commit is contained in:
parent
4a0ba5e5b1
commit
a895bdaf05
@ -92,11 +92,13 @@ void LinearAlgebraOp<InputScalar, OutputScalar>::Compute(
|
||||
TensorShapes input_matrix_shapes;
|
||||
TensorShape batch_shape;
|
||||
AnalyzeInputs(context, &inputs, &input_matrix_shapes, &batch_shape);
|
||||
if (!context->status().ok()) return;
|
||||
|
||||
TensorShapes output_matrix_shapes;
|
||||
TensorOutputs outputs;
|
||||
PrepareOutputs(context, input_matrix_shapes, batch_shape, &outputs,
|
||||
&output_matrix_shapes);
|
||||
if (!context->status().ok()) return;
|
||||
|
||||
// Process the individual matrix problems in parallel using a threadpool.
|
||||
auto shard = [this, &inputs, &input_matrix_shapes, &outputs,
|
||||
|
Loading…
Reference in New Issue
Block a user