Skip to content

Instantly share code, notes, and snippets.

@harunpehlivan
Forked from tanmayb123/py.swift
Created January 13, 2021 11:16
Show Gist options
  • Save harunpehlivan/23f7169bb13bbb86ac6797a7ff7e7a84 to your computer and use it in GitHub Desktop.
Save harunpehlivan/23f7169bb13bbb86ac6797a7ff7e7a84 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