You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 30, 2022. It is now read-only.
macOS 11.0.1. Xcode 12.2 beta 3. Swift For TensorFlow 0.12. My project successfully builds and links, but I immediately get this runtime error when I'm running my unit tests:
It looks like it can't find the symbol _$s11AllKeyPathss0B12PathIterablePTl
Is it perhaps related to this code in my project:
publicextensionKeyPathIterable{
/*
This is based on clipByGlobalNorm here:
https://github.com/tensorflow/swift-models/blob/542a03c09aa7bd6e326a18b5d086f2bec8b4b24c/Models/Text/BERT/Utilities.swift#L23
Get all tensors in a gradient and get their min values, max values, and if any values are nan
See a similar hasNaN callback here: https://github.com/tensorflow/swift-models/pull/526/files#diff-2b4e6467b43db097c85ce302b963fefe2ae32a9d42e7147143e0d088a5cc6c55R103
*/
func gradientMinsAndMaxes<Scalar:TensorFlowFloatingPoint>()->([Scalar],[Scalar],Bool){varmins:[Scalar]=[]varmaxes:[Scalar]=[]varhasNan:Bool=falseforkpinself.recursivelyAllWritableKeyPaths(to: Tensor<Scalar>.self){lettensor:Tensor<Scalar>=self[keyPath: kp]
mins.append(tensor.min().scalarized())
maxes.append(tensor.max().scalarized())if hasNan ==false{if tensor.isNaN.any(){
hasNan =true}}}return(mins, maxes, hasNan)}func numParamters<Scalar:TensorFlowFloatingPoint>()->Scalar{varnumParameters:Scalar=0forkpinself.recursivelyAllWritableKeyPaths(to: Tensor<Scalar>.self){lettensor:Tensor<Scalar>=self[keyPath: kp]
numParameters +=Scalar(tensor.shape.dimensions.cumulativeProduct())}return numParameters
}}
These KeyPathIterable extensions are very similar to swift-models code here and here.
Note that this is specific to macOS. The same project using S4TF 0.12 on Linux does not produce this runtime error. The unit tests pass without issue.
These unit tests do pass without issue on S4TF 0.11 on macOS, this is new with 0.12.
macOS 11.0.1. Xcode 12.2 beta 3. Swift For TensorFlow 0.12. My project successfully builds and links, but I immediately get this runtime error when I'm running my unit tests:
It looks like it can't find the symbol
_$s11AllKeyPathss0B12PathIterablePTlIs it perhaps related to this code in my project:
These
KeyPathIterableextensions are very similar to swift-models code here and here.