@@ -34,19 +34,19 @@ extension _AnyTensorHandle {
34
34
/// Class wrapping a C pointer to a TensorHandle. This class owns the
35
35
/// TensorHandle and is responsible for destroying it.
36
36
public class TFETensorHandle : _AnyTensorHandle {
37
- public let _cTensorHandle : CTensorHandle
37
+ public let _cTensorHandle : CTensorHandle
38
38
39
39
public var _tfeTensorHandle : TFETensorHandle { return self }
40
40
41
41
public init ( _owning base: CTensorHandle ) {
42
- self . _cTensorHandle = base
43
- }
42
+ self . _cTensorHandle = base
43
+ }
44
44
45
45
deinit {
46
- debugLog ( " De-initializing TensorHandle. " )
47
- TFE_DeleteTensorHandle ( _cTensorHandle)
48
- debugLog ( " Returning from deinit of TensorHandle. " )
49
- }
46
+ debugLog ( " De-initializing TensorHandle. " )
47
+ TFE_DeleteTensorHandle ( _cTensorHandle)
48
+ debugLog ( " Returning from deinit of TensorHandle. " )
49
+ }
50
50
}
51
51
52
52
@@ -55,8 +55,8 @@ public class TFETensorHandle: _AnyTensorHandle {
55
55
/// they are extracted into a tensor program.
56
56
public struct TensorHandle < Scalar> where Scalar: _TensorFlowDataTypeCompatible {
57
57
let handle : _AnyTensorHandle
58
-
59
- public var _cTensorHandle : CTensorHandle { handle. _cTensorHandle }
58
+
59
+ public var _cTensorHandle : CTensorHandle { handle. _cTensorHandle }
60
60
61
61
public init ( _owning cTensorHandle: CTensorHandle ) {
62
62
self . handle = TFETensorHandle ( _owning: cTensorHandle)
@@ -105,7 +105,7 @@ public struct TensorHandle<Scalar> where Scalar: _TensorFlowDataTypeCompatible {
105
105
extension TensorHandle where Scalar: TensorFlowScalar {
106
106
/// Create a `TensorHandle` with a closure that initializes the underlying buffer.
107
107
///
108
- /// `scalarsInitializer` receives a buffer with exactly enough capacity to hold the scalars in a
108
+ /// `scalarsInitializer` receives a buffer with exactly enough capacity to hold the scalars in a
109
109
/// tensor with shape `shape`. `scalarsInitializer` must initialize the entire buffer, with
110
110
/// contiguous scalars in row-major order.
111
111
@inlinable
@@ -123,7 +123,7 @@ extension TensorHandle where Scalar: TensorFlowScalar {
123
123
}
124
124
125
125
internal extension TensorHandle {
126
- /// Create a `ShapedArray` with contents of the underlying `TensorHandle`. If the `TensorHandle`
126
+ /// Create a `ShapedArray` with contents of the underlying `TensorHandle`. If the `TensorHandle`
127
127
/// is on the accelerator, it will be copied to the host.
128
128
/// - Returns: A `ShapedArray`.
129
129
@usableFromInline
@@ -140,7 +140,7 @@ public struct ResourceHandle {
140
140
141
141
@usableFromInline
142
142
var _cTensorHandle : CTensorHandle { handle. _cTensorHandle }
143
-
143
+
144
144
@usableFromInline
145
145
init ( owning cTensorHandle: CTensorHandle ) {
146
146
self . handle = TFETensorHandle ( _owning: cTensorHandle)
@@ -152,7 +152,7 @@ public struct VariantHandle {
152
152
153
153
@usableFromInline
154
154
var _cTensorHandle : CTensorHandle { handle. _cTensorHandle }
155
-
155
+
156
156
@usableFromInline
157
157
init ( owning cTensorHandle: CTensorHandle ) {
158
158
self . handle = TFETensorHandle ( _owning: cTensorHandle)
0 commit comments