@@ -32,7 +32,7 @@ public extension Tensor {
32
32
@inlinable
33
33
@differentiable ( vjp: _vjpInit ( repeating: shape: ) where Scalar: TensorFlowFloatingPoint)
34
34
init ( repeating repeatedValue: Scalar , shape: TensorShape ) {
35
- self = Raw . fill (
35
+ self = _Raw . fill (
36
36
dims: Tensor < Int32 > ( shape. dimensions. map ( Int32 . init) ) ,
37
37
value: Tensor ( repeatedValue) )
38
38
}
@@ -74,15 +74,15 @@ public extension Tensor where Scalar: Numeric {
74
74
/// Perform an element-wise type conversion from a `Bool` tensor.
75
75
@inlinable
76
76
init ( _ other: Tensor < Bool > ) {
77
- self = Raw . cast ( other)
77
+ self = _Raw . cast ( other)
78
78
}
79
79
80
80
/// Perform an element-wise conversion from another `Tensor`.
81
81
@inlinable
82
82
@differentiable (
83
83
vjp: _vjpCast where Scalar: TensorFlowFloatingPoint, OtherScalar: TensorFlowFloatingPoint)
84
84
init < OtherScalar: Numeric > ( _ other: Tensor < OtherScalar > ) {
85
- self = Raw . cast ( other)
85
+ self = _Raw . cast ( other)
86
86
}
87
87
}
88
88
@@ -104,7 +104,7 @@ public extension Tensor {
104
104
@inlinable
105
105
@differentiable ( vjp: _vjpInitElements where Scalar: TensorFlowFloatingPoint)
106
106
init ( _ elements: [ Tensor ] ) {
107
- self = Raw . pack ( elements)
107
+ self = _Raw . pack ( elements)
108
108
}
109
109
110
110
/// Stacks `tensors`, along the `axis` dimension, into a new tensor with rank one higher than
@@ -138,7 +138,7 @@ public extension Tensor {
138
138
@inlinable
139
139
@differentiable ( vjp: _vjpStacking where Scalar: TensorFlowFloatingPoint)
140
140
init ( stacking tensors: [ Tensor ] , alongAxis axis: Int = 0 ) {
141
- self = Raw . pack ( tensors, axis: Int64 ( axis) )
141
+ self = _Raw . pack ( tensors, axis: Int64 ( axis) )
142
142
}
143
143
144
144
/// Concatenates `tensors` along the `axis` dimension.
@@ -177,7 +177,7 @@ public extension Tensor {
177
177
@differentiable ( vjp: _vjpConcatenating where Scalar: TensorFlowFloatingPoint)
178
178
init ( concatenating tensors: [ Tensor ] , alongAxis axis: Int = 0 ) {
179
179
precondition ( tensors. count > 0 )
180
- self = Raw . concatV2 ( tensors, axis: Tensor < Int32 > ( Int32 ( axis) ) )
180
+ self = _Raw . concatV2 ( tensors, axis: Tensor < Int32 > ( Int32 ( axis) ) )
181
181
}
182
182
}
183
183
@@ -242,7 +242,7 @@ public extension Tensor where Scalar: Numeric {
242
242
/// - Parameter other: Tensor whose shape and data type to use.
243
243
@inlinable
244
244
init ( zerosLike other: Tensor ) {
245
- self = Raw . zerosLike ( other)
245
+ self = _Raw . zerosLike ( other)
246
246
}
247
247
248
248
/// Creates a tensor with all scalars set to one that has the same shape and type as the provided
@@ -251,7 +251,7 @@ public extension Tensor where Scalar: Numeric {
251
251
/// - Parameter other: Tensor whose shape and data type to use.
252
252
@inlinable
253
253
init ( onesLike other: Tensor ) {
254
- self = Raw . onesLike ( other)
254
+ self = _Raw . onesLike ( other)
255
255
}
256
256
257
257
/// Creates a 1-D tensor representing a sequence from a starting value to, but not including,
@@ -266,7 +266,7 @@ public extension Tensor where Scalar: Numeric {
266
266
/// positive.
267
267
@inlinable
268
268
init ( rangeFrom start: Scalar , to end: Scalar , stride: Scalar ) {
269
- self = Raw . range ( start: Tensor ( start) , limit: Tensor ( end) , delta: Tensor ( stride) )
269
+ self = _Raw . range ( start: Tensor ( start) , limit: Tensor ( end) , delta: Tensor ( stride) )
270
270
}
271
271
272
272
/// Creates a 1-D tensor representing a sequence from a starting value to, but not including, an
@@ -280,7 +280,7 @@ public extension Tensor where Scalar: Numeric {
280
280
/// - stride: The amount to step by with each iteration. `stride` must be positive.
281
281
@inlinable
282
282
init ( rangeFrom start: Tensor < Scalar > , to end: Tensor < Scalar > , stride: Tensor < Scalar > ) {
283
- self = Raw . range ( start: start, limit: end, delta: stride)
283
+ self = _Raw . range ( start: start, limit: end, delta: stride)
284
284
}
285
285
286
286
/// Creates a one-hot tensor at given indices. The locations represented by
@@ -318,7 +318,7 @@ public extension Tensor where Scalar: Numeric {
318
318
offValue: Scalar = 0 ,
319
319
axis: Int = - 1
320
320
) {
321
- self = Raw . oneHot (
321
+ self = _Raw . oneHot (
322
322
indices: indices,
323
323
depth: Tensor < Int32 > ( Int32 ( depth) ) ,
324
324
onValue: Tensor ( onValue) ,
@@ -339,7 +339,7 @@ public extension Tensor where Scalar: TensorFlowFloatingPoint {
339
339
/// - count: The number of values in the resulting sequence. `count` must be positive.
340
340
@inlinable
341
341
init ( linearSpaceFrom start: Scalar , to end: Scalar , count: Int ) {
342
- self = Raw . linSpace (
342
+ self = _Raw . linSpace (
343
343
start: Tensor ( start) , stop: Tensor ( end) , num: Tensor < Int32 > ( Int32 ( count) ) )
344
344
}
345
345
@@ -356,7 +356,7 @@ public extension Tensor where Scalar: TensorFlowFloatingPoint {
356
356
/// - Precondition: `start`, `to`, and `count` must be Tensors containing a single Scalar value.
357
357
@inlinable
358
358
init ( linearSpaceFrom start: Tensor < Scalar > , to end: Tensor < Scalar > , count: Tensor < Int32 > ) {
359
- self = Raw . linSpace ( start: start, stop: end, num: count)
359
+ self = _Raw . linSpace ( start: start, stop: end, num: count)
360
360
}
361
361
}
362
362
@@ -379,7 +379,7 @@ public extension Tensor where Scalar: TensorFlowIndex {
379
379
upperBound: Tensor < Scalar > = Tensor < Scalar > ( 1 ) ,
380
380
seed: TensorFlowSeed = Context . local. randomSeed
381
381
) {
382
- self = Raw . statelessRandomUniformInt (
382
+ self = _Raw . statelessRandomUniformInt (
383
383
shape: Tensor < Int32 > ( ( 0 ..< shape. rank) . map { Int32 ( shape [ $0] ) } ) ,
384
384
seed: Tensor < Int32 > ( [ seed. graph, seed. op] ) ,
385
385
minval: lowerBound,
@@ -402,7 +402,7 @@ public extension Tensor where Scalar: TensorFlowFloatingPoint {
402
402
upperBound: Tensor < Scalar > = Tensor < Scalar > ( 1 ) ,
403
403
seed: TensorFlowSeed = Context . local. randomSeed
404
404
) {
405
- let sample : Tensor < Scalar > = Raw . statelessRandomUniform (
405
+ let sample : Tensor < Scalar > = _Raw . statelessRandomUniform (
406
406
shape: Tensor < Int32 > ( ( 0 ..< shape. rank) . map { Int32 ( shape [ $0] ) } ) ,
407
407
seed: Tensor < Int32 > ( [ seed. graph, seed. op] ) )
408
408
self = ( upperBound - lowerBound) * sample + lowerBound
@@ -422,7 +422,7 @@ public extension Tensor where Scalar: TensorFlowFloatingPoint {
422
422
standardDeviation: Tensor < Scalar > = Tensor < Scalar > ( 1 ) ,
423
423
seed: TensorFlowSeed = Context . local. randomSeed
424
424
) {
425
- let sample : Tensor < Scalar > = Raw . statelessRandomNormal (
425
+ let sample : Tensor < Scalar > = _Raw . statelessRandomNormal (
426
426
shape: Tensor < Int32 > ( ( 0 ..< shape. rank) . map { Int32 ( shape [ $0] ) } ) ,
427
427
seed: Tensor < Int32 > ( [ seed. graph, seed. op] ) )
428
428
self = standardDeviation * sample + mean
0 commit comments