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

Method WithDevice

tensorflow/go/op/scope.go:142–151  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

140//
141// An empty string removes any device restrictions.
142func (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.

Callers 3

TestDeviceFunction · 0.95
TestHashNodeDefMethod · 0.45

Calls

no outgoing calls

Tested by 3

TestDeviceFunction · 0.76
TestHashNodeDefMethod · 0.36