@@ -50,19 +50,19 @@ class LazyTensorHandle: _AnyTensorHandle {
50
50
precondition (
51
51
index < op. outputCount, " Symbolic Tensor Index is out-of-bounds " )
52
52
handle = Handle . symbolic ( op, index: index, isLive: false )
53
- LazyTensorContext . operationsTracker. incrementRefCount ( op, isLive: false )
53
+ LazyTensorContext . local . operationsTracker. incrementRefCount ( op, isLive: false )
54
54
}
55
55
56
56
init ( _lazyLive op: LazyTensorOperation , index: Int ) {
57
57
precondition (
58
58
index < op. outputCount, " Symbolic Tensor Index is out-of-bounds " )
59
59
handle = Handle . symbolic ( op, index: index, isLive: true )
60
- LazyTensorContext . operationsTracker. incrementRefCount ( op, isLive: true )
60
+ LazyTensorContext . local . operationsTracker. incrementRefCount ( op, isLive: true )
61
61
}
62
62
63
63
deinit {
64
64
if case let . symbolic( op, _, isLive) = handle {
65
- LazyTensorContext . operationsTracker. decrementRefCount ( op, isLive: isLive)
65
+ LazyTensorContext . local . operationsTracker. decrementRefCount ( op, isLive: isLive)
66
66
}
67
67
}
68
68
@@ -80,7 +80,7 @@ class LazyTensorHandle: _AnyTensorHandle {
80
80
get {
81
81
switch handle {
82
82
case . symbolic( let op, let index, _) :
83
- precondition ( LazyTensorContext . isShapeTrackingEnabled,
83
+ precondition ( LazyTensorContext . local . isShapeTrackingEnabled,
84
84
" Shape tracking is not enabled in this context. " )
85
85
if let shape = op. outputShapes [ index] { return shape }
86
86
// Materialize and get the shape from concrete tensor handle.
@@ -102,19 +102,19 @@ class LazyTensorHandle: _AnyTensorHandle {
102
102
// Liveness tracking for LazyTensorOperations
103
103
//
104
104
static func isLive( _ op: LazyTensorOperation ) -> Bool {
105
- return LazyTensorContext . operationsTracker. isLive ( op)
105
+ return LazyTensorContext . local . operationsTracker. isLive ( op)
106
106
}
107
107
108
108
static func forEachLiveOperation(
109
109
_ perform: ( LazyTensorOperation ) throws -> Void
110
110
) rethrows -> Void {
111
- try LazyTensorContext . operationsTracker. forEachLiveOperation ( perform)
111
+ try LazyTensorContext . local . operationsTracker. forEachLiveOperation ( perform)
112
112
}
113
113
114
114
static func forEachOperation(
115
115
_ perform: ( LazyTensorOperation ) throws -> Void
116
116
) rethrows -> Void {
117
- try LazyTensorContext . operationsTracker. forEachOperation ( perform)
117
+ try LazyTensorContext . local . operationsTracker. forEachOperation ( perform)
118
118
}
119
119
120
120
@usableFromInline
@@ -263,7 +263,7 @@ class LazyTensorOperation: TensorOperation {
263
263
}
264
264
265
265
func evaluate( ) -> [ LazyTensorHandle ] {
266
- if LazyTensorContext . isShapeTrackingEnabled {
266
+ if LazyTensorContext . local . isShapeTrackingEnabled {
267
267
updateOutputShapes ( )
268
268
}
269
269
return ( 0 ..< outputCount) . map {
0 commit comments