diff options
Diffstat (limited to 'tensorflow/go/operation.go')
-rw-r--r-- | tensorflow/go/operation.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tensorflow/go/operation.go b/tensorflow/go/operation.go index baaac41f4e..25ec718703 100644 --- a/tensorflow/go/operation.go +++ b/tensorflow/go/operation.go @@ -131,6 +131,9 @@ func (p Output) canBeAnInput() {} // Consumers returns the inputs that consume this output. func (p Output) Consumers() []Consumer { max := int(C.TF_OperationOutputNumConsumers(p.c())) + if max == 0 { + return nil + } inputs := make([]C.TF_Input, max) n := C.TF_OperationOutputConsumers(p.c(), (*C.TF_Input)(unsafe.Pointer(&inputs[0])), C.int(max)) inputs = inputs[:int(n)] |