MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Consumers

Method Consumers

tensorflow/go/operation.go:138–159  ·  view source on GitHub ↗

Consumers returns the inputs that consume this output.

()

Source from the content-addressed store, hash-verified

136
137// Consumers returns the inputs that consume this output.
138func (p Output) Consumers() []Consumer {
139 max := int(C.TF_OperationOutputNumConsumers(p.c()))
140 if max == 0 {
141 return nil
142 }
143 inputs := make([]C.TF_Input, max)
144 n := C.TF_OperationOutputConsumers(p.c(), (*C.TF_Input)(unsafe.Pointer(&inputs[0])), C.int(max))
145 inputs = inputs[:int(n)]
146
147 var consumers []Consumer
148 for _, consumer := range inputs {
149 consumers = append(consumers, Consumer{
150 Index: int(consumer.index),
151 Op: &Operation{
152 c: consumer.oper,
153 g: p.Op.g,
154 },
155 })
156 }
157
158 return consumers
159}
160
161// Consumer identifies a specific input of an operation that consumes the output
162// of another operation.

Callers 1

TestOperationConsumersFunction · 0.80

Calls 3

cMethod · 0.95
makeFunction · 0.85
appendFunction · 0.85

Tested by 1

TestOperationConsumersFunction · 0.64