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

Commit 3b12123

Browse files
committed
Fix style and indentation.
1 parent 949c9f4 commit 3b12123

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

Sources/TensorFlow/Core/LazyTensorOperation.swift

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -687,26 +687,24 @@ extension LazyTensor: CustomStringConvertible {
687687

688688
extension LazyTensorOperation: CustomStringConvertible {
689689
public var description: String {
690-
let attrsDesc = attrs.keys.sorted(by: <).map { "\($0): \(attrs[$0]!)" }
691-
let inputsDesc = inputs.map { (input: Input) -> String in
690+
let attrsDesc = attrs.sorted(by: { $0.key < $1.key }).map { "\($0): \($1)" }
691+
let inputsDesc = inputs.map { input -> String in
692692
switch input {
693693
case Input.single(let lazyTensor):
694694
return "\(lazyTensor)"
695695
case Input.list(let lazyTensorList):
696-
do {
697-
let lazyTensors = lazyTensorList.map { "\($0)" }
698-
let lazyTensorsDesc = lazyTensors.joined(separator: ", ")
699-
return "[\(lazyTensorsDesc)]"
700-
}
696+
let lazyTensors = lazyTensorList.map { "\($0)" }
697+
let lazyTensorsDesc = lazyTensors.joined(separator: ", ")
698+
return "[\(lazyTensorsDesc)]"
701699
}
702700
}
703701
var desc = "\(outputName) = \(name)"
704-
if attrs.count > 0 {
702+
if !attributes.isEmpty {
705703
desc += "["
706704
desc += attrsDesc.joined(separator: ", ")
707705
desc += "]"
708706
}
709-
desc += "("
707+
desc += "("
710708
desc += inputsDesc.joined(separator: ", ")
711709
desc += ")"
712710
return desc

0 commit comments

Comments
 (0)