File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -344,8 +344,9 @@ func _vjpPow<T : TensorFlowFloatingPoint>(
344
344
) -> ( Tensor < T > , ( Tensor < T > ) -> ( Tensor < T > , Tensor < T > ) ) {
345
345
let value = pow ( x, y)
346
346
return ( value, { v in
347
- ( ( v * y * pow( x, y- 1 ) ) . unbroadcast ( like: x) ,
348
- ( v * log( x) * value) . unbroadcast ( like: y) )
347
+ let dfdx = v * y * pow( x, y- 1 )
348
+ let dfdy = v * log( x) * value
349
+ return ( dfdx. unbroadcast ( like: x) , dfdy. unbroadcast ( like: y) )
349
350
} )
350
351
}
351
352
Original file line number Diff line number Diff line change @@ -1923,7 +1923,7 @@ internal extension Tensor.IndexPath {
1923
1923
@inlinable
1924
1924
init ( _ ranges: [ TensorRange ] ) {
1925
1925
precondition ( !ranges. isEmpty, " The tensor range collection cannot be empty. " )
1926
- precondition ( ranges. count { $0 == TensorRange . ellipsis } < 2 ,
1926
+ precondition ( ranges. count ( where : { $0 == TensorRange . ellipsis } ) < 2 ,
1927
1927
" Only one ellipsis is allowed per tensor range collection. " )
1928
1928
1929
1929
var begin = [ Int32] ( repeating: 0 , count: ranges. count)
You can’t perform that action at this time.
0 commit comments