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

Commit d38ffc5

Browse files
committed
maybeMaterialized -> materializedAsNeeded
1 parent 9aefe8d commit d38ffc5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Sources/TensorFlow/Core/LazyTensorOperation.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -750,8 +750,8 @@ extension LazyTensorOperation {
750750
private func maybeMaterializeInputs() {
751751
/// If `lazyTensor` is symbolic and the associated `LazyTensorOperation`
752752
/// has been materialized, return the corresponding concrete `LazyTensor`.
753-
/// Otherwise, return `lazyTensor` untouched.
754-
func maybeMaterialized(lazyTensor: LazyTensor) -> LazyTensor {
753+
/// Otherwise, return `lazyTensor` untouched.
754+
func materializedAsNeeded(lazyTensor: LazyTensor) -> LazyTensor {
755755
let handle = lazyTensor.handle
756756
if case let LazyTensor.Handle.symbolic(lazyOp, index, _) = handle,
757757
let outputs = lazyOp.outputs {
@@ -764,15 +764,15 @@ extension LazyTensorOperation {
764764
/// materialized have been replaced by the corresponding concerete
765765
/// inputs. If no symbolic values have been materialized or if there are
766766
/// no symbolic values, return the `input` untouched.
767-
func maybeMaterialized(input: Input) -> Input {
767+
func materializedAsNeeded(input: Input) -> Input {
768768
switch input {
769769
case .single(let h):
770-
return .single(maybeMaterialized(lazyTensor: h))
770+
return .single(materializedAsNeeded(lazyTensor: h))
771771
case .list(let elements):
772-
return .list(elements.map { maybeMaterialized(lazyTensor: $0) })
772+
return .list(elements.map { materializedAsNeeded(lazyTensor: $0) })
773773
}
774774
}
775-
inputs = inputs.map { maybeMaterialized(input: $0) }
775+
inputs = inputs.map { materializedAsNeeded(input: $0) }
776776
}
777777

778778
private func materializeLiveTensors() {

0 commit comments

Comments
 (0)