@@ -27,21 +27,18 @@ infix operator .==: ComparisonPrecedence
27
27
public extension Tensor {
28
28
/// The rank of the tensor, represented as a `Tensor<Int32>`.
29
29
@inlinable
30
- @_semantics ( " autodiff.nonvarying " )
31
30
var rankTensor : Tensor < Int32 > {
32
31
return Raw . rank ( self )
33
32
}
34
33
35
34
/// The dimensions of the tensor, represented as a `Tensor<Int32>`.
36
35
@inlinable
37
- @_semantics ( " autodiff.nonvarying " )
38
36
var shapeTensor : Tensor < Int32 > {
39
37
return Raw . shape ( self )
40
38
}
41
39
42
40
/// The number of scalars in the tensor, represented as a `Tensor<Int32>`.
43
41
@inlinable
44
- @_semantics ( " autodiff.nonvarying " )
45
42
var scalarCountTensor : Tensor < Int32 > {
46
43
return Raw . size ( self )
47
44
}
@@ -56,7 +53,6 @@ extension Tensor: CustomStringConvertible {
56
53
/// A textual representation of the tensor.
57
54
///
58
55
/// - Note: use `fullDescription` for a non-pretty-printed description showing all scalars.
59
- @_semantics ( " autodiff.nonvarying " )
60
56
public var description : String {
61
57
return array. description
62
58
}
@@ -73,7 +69,6 @@ public extension Tensor {
73
69
/// via ellipses (`...`).
74
70
/// - summarizing: If true, summarize description if element count exceeds twice
75
71
/// `edgeElementCount`.
76
- @_semantics ( " autodiff.nonvarying " )
77
72
func description(
78
73
lineWidth: Int = 80 ,
79
74
edgeElementCount: Int = 3 ,
@@ -87,23 +82,20 @@ public extension Tensor {
87
82
88
83
/// A full, non-pretty-printed textual representation of the tensor, showing
89
84
/// all scalars.
90
- @_semantics ( " autodiff.nonvarying " )
91
85
var fullDescription : String {
92
86
return array. fullDescription
93
87
}
94
88
}
95
89
96
90
// Xcode Playground display conversion.
97
91
extension Tensor : CustomPlaygroundDisplayConvertible {
98
- @_semantics ( " autodiff.nonvarying " )
99
92
public var playgroundDescription : Any {
100
93
return description
101
94
}
102
95
}
103
96
104
97
// Mirror representation, used by debugger/REPL.
105
98
extension Tensor : CustomReflectable {
106
- @_semantics ( " autodiff.nonvarying " )
107
99
public var customMirror : Mirror {
108
100
return Mirror ( self , children: [ ] , displayStyle: . struct)
109
101
}
0 commit comments