Skip to content

Commit 35f484d

Browse files
committed
Return empty list if no inputs
1 parent 2834ba5 commit 35f484d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/AI/TensorFlow/Libtensorflow/Operation.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ $ffi->attach( [ 'OperationAllInputs' => 'AllInputs' ] => [
180180
] => 'void' => sub {
181181
my ($xs, $oper) = @_;
182182
my $max_inputs = $oper->NumInputs;
183+
return [] if $max_inputs == 0;
183184
my $inputs = AI::TensorFlow::Libtensorflow::Output->_adef->create(0 + $max_inputs);
184185
$xs->($oper, $inputs, $max_inputs);
185186
return AI::TensorFlow::Libtensorflow::Output->_from_array($inputs);

0 commit comments

Comments
 (0)