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

Method SubScope

tensorflow/go/op/scope.go:97–110  ·  view source on GitHub ↗

SubScope returns a new Scope which will cause all operations added to the graph to be namespaced with 'namespace'. If namespace collides with an existing namespace within the scope, then a suffix will be added.

(namespace string)

Source from the content-addressed store, hash-verified

95// graph to be namespaced with 'namespace'. If namespace collides with an
96// existing namespace within the scope, then a suffix will be added.
97func (s *Scope) SubScope(namespace string) *Scope {
98 namespace = s.uniqueName(namespace)
99 if s.namespace != "" {
100 namespace = s.namespace + "/" + namespace
101 }
102 return &Scope{
103 graph: s.graph,
104 namemap: make(map[string]int),
105 namespace: namespace,
106 controlDependencies: s.controlDependencies,
107 device: s.device,
108 err: s.err,
109 }
110}
111
112// WithControlDependencies returns a new Scope which will cause all operations
113// added to the graph to execute only after all the provided operations have

Callers 15

TestPlaceholderFunction · 0.95
TestShapeAttributeFunction · 0.95
TestDeviceFunction · 0.95
TestMultipleGeneratedOpsFunction · 0.95
TestAddGradientsFunction · 0.80
TestAddGradientsSumsFunction · 0.80
TestScopeSubScopeFunction · 0.80

Calls 2

uniqueNameMethod · 0.95
makeFunction · 0.85

Tested by 15

TestPlaceholderFunction · 0.76
TestShapeAttributeFunction · 0.76
TestDeviceFunction · 0.76
TestMultipleGeneratedOpsFunction · 0.76
TestAddGradientsFunction · 0.64
TestAddGradientsSumsFunction · 0.64
TestScopeSubScopeFunction · 0.64