Comments (3)
@dynamicCallable
is done as of apple/swift@2142075 and has been added to PythonObject
.
You can now run the following:
$ swift
Welcome to Swift version 4.2-dev (LLVM 04bdb56f3d, Clang b44dbbdf44, Swift 70260a59ef). Type :help for assistance.
1> import Python
2. let np = Python.import("numpy")
np: Python.PythonObject = <module 'numpy' from '/Users/danielzheng/Library/Python/2.7/lib/python/site-packages/numpy/__init__.pyc'>
3> let a = np.arange(15).reshape(3, 5)
a: Python.PythonObject =
[[ 0 1 2 3 4]
[ 5 6 7 8 9]
[10 11 12 13 14]]
4> let b = np.array([6, 7, 8])
b: Python.PythonObject = [6 7 8]
Please download the latest Swift for TensorFlow packages to try it out!
from swift.
This is because @dynamicCallable
is not yet implemented.
Until then, you'll need to write .call(with:)
explicitly:
np.arange.call(with: 15).reshape.call(with: 3, 5)
@dynamicCallable
is currently being implemented and should be pushed within a week! I'll update here when it's pushed.
from swift.
Got it, Thanks!
from swift.
Related Issues (20)
- Make README logo have a transparent background HOT 1
- Unit Tests Pass But tensorflow Produces Non-zero Exit Status HOT 7
- Throwing and Import
- bomba HOT 1
- Can't run in macOS SwiftUI App HOT 4
- PythonKit error during build: Xcode 12.4, toolchain 0.12 HOT 3
- Any way to reverse Swift Link List Output HOT 1
- Project shutting down ? HOT 4
- Errors while switching to stock toolchain HOT 9
- Swift
- Gopi
- Hi
- Cannot load underlying module for 'Darwin
- Unable to determine Swift version for the following pods
- Why archive? HOT 2
- Force install Swift for TensorFlow on Google Colaboratory HOT 3
- Ultracalm
- Resurrect S4TF HOT 3
- Future implementation of quantization
- Swift HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swift.