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

Commit fb3135c

Browse files
dan-zhengrxwei
authored andcommitted
Fix compilation errors. (#224)
* Fix compilation errors. * Fix warnings.
1 parent df8e2a5 commit fb3135c

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

Sources/TensorFlow/Bindings/EagerExecution.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,13 +266,15 @@ internal struct TFE_Op: TFTensorOperation {
266266
}
267267
}
268268

269+
@inlinable @inline(__always)
269270
internal func updateAttribute<In: TensorGroup, Out: TensorGroup>(
270271
_ name: String,
271272
_ value: (In) -> Out
272273
) {
273274
updateAttribute(name, _TensorFunctionPointer(name: _tffunc(value)))
274275
}
275276

277+
@inlinable @inline(__always)
276278
internal func updateAttribute(_ name: String, _ value: _TensorFunctionPointer) {
277279
value.name.utf8CString.withUnsafeBufferPointer { buffer in
278280
// utf8CString is null-terminated; TFE_OpSetAttrFunctionName wants

Sources/TensorFlow/Bindings/TFTensorOperation.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515
/// Opaque reference to a function that has been made callable by loading it
1616
/// into the runtime.
1717
public struct _TensorFunctionPointer {
18-
var name: String
18+
public var name: String
19+
public init(name: String) {
20+
self.name = name
21+
}
1922
}
2023

2124
// A protocol for a tensor operation.

Sources/TensorFlow/Core/LazyTensorOperation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class LazyTensor: _AnyTensorHandle {
3333
switch handle {
3434
case .concrete(let h, _):
3535
return h
36-
case .symbolic(let op, let index, _):
36+
case .symbolic(_, _, _):
3737
assert(false, "TODO: to be send out in a separate PR.")
3838
// return op.materialized(index: index)
3939
}

0 commit comments

Comments
 (0)