@@ -131,7 +131,7 @@ extension Tensor {
131
131
/// Reshape to scalar.
132
132
/// - Precondition: The tensor has exactly one scalar.
133
133
@inlinable
134
- @differentiable ( where Scalar: TensorFlowFloatingPoint)
134
+ @differentiable ( where Scalar: TensorFlowFloatingPoint)
135
135
public func scalarized( ) -> Scalar {
136
136
precondition (
137
137
shape. contiguousSize == 1 ,
@@ -174,7 +174,7 @@ extension Tensor {
174
174
return handle. makeHostCopy ( )
175
175
}
176
176
177
- @differentiable ( where Scalar: TensorFlowFloatingPoint)
177
+ @differentiable ( where Scalar: TensorFlowFloatingPoint)
178
178
public var scalars : [ Scalar ] {
179
179
#if USING_X10_BACKEND
180
180
if handle. backend == . XLA {
@@ -205,7 +205,7 @@ extension Tensor where Scalar: TensorFlowFloatingPoint {
205
205
206
206
extension Tensor {
207
207
/// Creates a 0-D tensor from a scalar value.
208
- @differentiable ( where Scalar: TensorFlowFloatingPoint)
208
+ @differentiable ( where Scalar: TensorFlowFloatingPoint)
209
209
public init ( _ value: Scalar , on device: Device = . default) {
210
210
#if USING_X10_BACKEND
211
211
switch device. backend {
@@ -233,7 +233,7 @@ extension Tensor where Scalar: TensorFlowFloatingPoint {
233
233
extension Tensor {
234
234
/// Creates a 1D tensor from scalars.
235
235
@inlinable
236
- @differentiable ( where Scalar: TensorFlowFloatingPoint)
236
+ @differentiable ( where Scalar: TensorFlowFloatingPoint)
237
237
public init ( _ scalars: [ Scalar ] , on device: Device = . default) {
238
238
self . init ( shape: [ scalars. count] , scalars: scalars, on: device)
239
239
}
@@ -266,7 +266,7 @@ extension Tensor {
266
266
/// - scalars: The scalar contents of the tensor.
267
267
/// - Precondition: The product of the dimensions of the shape must equal the number of scalars.
268
268
@inlinable
269
- @differentiable ( where Scalar: TensorFlowFloatingPoint)
269
+ @differentiable ( where Scalar: TensorFlowFloatingPoint)
270
270
public init ( shape: TensorShape , scalars: [ Scalar ] , on device: Device = . default) {
271
271
precondition (
272
272
shape. contiguousSize == scalars. count,
@@ -677,15 +677,15 @@ extension Tensor: AdditiveArithmetic where Scalar: Numeric {
677
677
/// Adds two tensors and produces their sum.
678
678
/// - Note: `+` supports broadcasting.
679
679
@inlinable
680
- @differentiable ( where Scalar: TensorFlowFloatingPoint)
680
+ @differentiable ( where Scalar: TensorFlowFloatingPoint)
681
681
public static func + ( lhs: Tensor , rhs: Tensor ) -> Tensor {
682
682
_Raw. addV2 ( lhs, rhs)
683
683
}
684
684
685
685
/// Subtracts one tensor from another and produces their difference.
686
686
/// - Note: `-` supports broadcasting.
687
687
@inlinable
688
- @differentiable ( where Scalar: TensorFlowFloatingPoint)
688
+ @differentiable ( where Scalar: TensorFlowFloatingPoint)
689
689
public static func - ( lhs: Tensor , rhs: Tensor ) -> Tensor {
690
690
_Raw. sub ( lhs, rhs)
691
691
}
0 commit comments