WithDevice returns a new Scope which will cause all operations added to the graph to execute on devices that match the provided device specification. For example, WithDevice("/device:GPU:0") will cause operations added to the graph to execute on GPU #0. An empty string removes any device restricti
(device string)
| 140 | // |
| 141 | // An empty string removes any device restrictions. |
| 142 | func (s *Scope) WithDevice(device string) *Scope { |
| 143 | return &Scope{ |
| 144 | graph: s.graph, |
| 145 | namemap: s.namemap, |
| 146 | namespace: s.namespace, |
| 147 | controlDependencies: s.controlDependencies, |
| 148 | device: device, |
| 149 | err: s.err, |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | // Err returns the error, if any, encountered during the construction |
| 154 | // of the Graph managed by s. |
no outgoing calls