Skip to content

Instantly share code, notes, and snippets.

@tanmayb123
Created July 18, 2019 15:34
Show Gist options
  • Save tanmayb123/f43daf99a810f29afd1b9233a2f4a1fc to your computer and use it in GitHub Desktop.
Save tanmayb123/f43daf99a810f29afd1b9233a2f4a1fc to your computer and use it in GitHub Desktop.
import TensorFlow
import Python
let np = Python.import("numpy")
let randomNumbers = Tensor<Float>(randomUniform: [5, 5])
print(randomNumbers)
let rotatedRandomNumbers = Tensor<Float>(numpy: np.rot90(randomNumbers.makeNumpyArray()))
print(rotatedRandomNumbers)
print(np.fliplr(rotatedRandomNumbers.makeNumpyArray()).shape)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment