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

Commit 6843c95

Browse files
committed
Add a precondition to materialization.
1 parent d234be9 commit 6843c95

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Sources/TensorFlow/Core/LazyTensorOperation.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,7 @@ extension LazyTensorOperation: CustomStringConvertible {
728728
extension LazyTensorOperation {
729729
/// Returns the materialized value at the given output `index`.
730730
func materialized(index: Int) -> TFETensorHandle {
731+
precondition(index < outputCount)
731732
return materialized()[index]
732733
}
733734

0 commit comments

Comments
 (0)