Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions stdlib/public/TensorFlow/Tensor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -632,13 +632,15 @@ public extension Tensor {
/// Reshape to the shape of the specified `Tensor`.
/// - Precondition: The number of scalars matches the new shape.
@inlinable @inline(__always)
@differentiable(wrt: self where Scalar : TensorFlowFloatingPoint)
func reshaped<T>(like other: Tensor<T>) -> Tensor {
return reshaped(toShape: other.shapeTensor)
}

/// Reshape to the specified shape.
/// - Precondition: The number of scalars matches the new shape.
@inlinable @inline(__always)
@differentiable(wrt: self where Scalar : TensorFlowFloatingPoint)
func reshaped(to newShape: TensorShape) -> Tensor {
return reshaped(toShape: Tensor<Int32>(newShape.dimensions))
}
Expand Down