Skip to content
This repository was archived by the owner on Jul 1, 2023. It is now read-only.

Replacing tabs with spaces in TensorHandle.swift. #167

Merged
merged 1 commit into from
Jun 2, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions Sources/TensorFlow/Core/TensorHandle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,19 @@ extension _AnyTensorHandle {
/// Class wrapping a C pointer to a TensorHandle. This class owns the
/// TensorHandle and is responsible for destroying it.
public class TFETensorHandle: _AnyTensorHandle {
public let _cTensorHandle: CTensorHandle
public let _cTensorHandle: CTensorHandle

public var _tfeTensorHandle: TFETensorHandle { return self }

public init(_owning base: CTensorHandle) {
self._cTensorHandle = base
}
self._cTensorHandle = base
}

deinit {
debugLog("De-initializing TensorHandle.")
TFE_DeleteTensorHandle(_cTensorHandle)
debugLog("Returning from deinit of TensorHandle.")
}
debugLog("De-initializing TensorHandle.")
TFE_DeleteTensorHandle(_cTensorHandle)
debugLog("Returning from deinit of TensorHandle.")
}
}


Expand All @@ -55,8 +55,8 @@ public class TFETensorHandle: _AnyTensorHandle {
/// they are extracted into a tensor program.
public struct TensorHandle<Scalar> where Scalar: _TensorFlowDataTypeCompatible {
let handle: _AnyTensorHandle
public var _cTensorHandle: CTensorHandle { handle._cTensorHandle }

public var _cTensorHandle: CTensorHandle { handle._cTensorHandle }

public init(_owning cTensorHandle: CTensorHandle) {
self.handle = TFETensorHandle(_owning: cTensorHandle)
Expand Down Expand Up @@ -105,7 +105,7 @@ public struct TensorHandle<Scalar> where Scalar: _TensorFlowDataTypeCompatible {
extension TensorHandle where Scalar: TensorFlowScalar {
/// Create a `TensorHandle` with a closure that initializes the underlying buffer.
///
/// `scalarsInitializer` receives a buffer with exactly enough capacity to hold the scalars in a
/// `scalarsInitializer` receives a buffer with exactly enough capacity to hold the scalars in a
/// tensor with shape `shape`. `scalarsInitializer` must initialize the entire buffer, with
/// contiguous scalars in row-major order.
@inlinable
Expand All @@ -123,7 +123,7 @@ extension TensorHandle where Scalar: TensorFlowScalar {
}

internal extension TensorHandle {
/// Create a `ShapedArray` with contents of the underlying `TensorHandle`. If the `TensorHandle`
/// Create a `ShapedArray` with contents of the underlying `TensorHandle`. If the `TensorHandle`
/// is on the accelerator, it will be copied to the host.
/// - Returns: A `ShapedArray`.
@usableFromInline
Expand All @@ -140,7 +140,7 @@ public struct ResourceHandle {

@usableFromInline
var _cTensorHandle: CTensorHandle { handle._cTensorHandle }

@usableFromInline
init(owning cTensorHandle: CTensorHandle) {
self.handle = TFETensorHandle(_owning: cTensorHandle)
Expand All @@ -152,7 +152,7 @@ public struct VariantHandle {

@usableFromInline
var _cTensorHandle: CTensorHandle { handle._cTensorHandle }

@usableFromInline
init(owning cTensorHandle: CTensorHandle) {
self.handle = TFETensorHandle(_owning: cTensorHandle)
Expand Down