{ "info": { "author": "Andreas @blackhc Kirsch", "author_email": "blackhc+tfpyth@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# TfPyTh\n\n[![Build Status](https://travis-ci.com/BlackHC/tfpyth.svg?branch=master)](https://travis-ci.com/BlackHC/tfpyth) [![codecov](https://codecov.io/gh/BlackHC/tfpyth/branch/master/graph/badge.svg)](https://codecov.io/gh/BlackHC/tfpyth)\n\nPutting TensorFlow back in PyTorch, back in TensorFlow (differentiable TensorFlow PyTorch adapters).\n\n> A light-weight differentiable adapter library to make TensorFlow and PyTorch interact.\n\n## Install\n\n```\npip install tfpyth\n```\n\n### Example\n\n```python\nimport tensorflow as tf\nimport torch as th\nimport numpy as np\nimport tfpyth\n\nsession = tf.Session()\n\ndef get_torch_function():\n a = tf.placeholder(tf.float32, name='a')\n b = tf.placeholder(tf.float32, name='b')\n c = 3 * a + 4 * b * b\n\n f = tfpyth.torch_from_tensorflow(session, [a, b], c).apply\n return f\n\nf = get_torch_function()\na = th.tensor(1, dtype=th.float32, requires_grad=True)\nb = th.tensor(3, dtype=th.float32, requires_grad=True)\nx = f(a, b)\n\nassert x == 39.\n\nx.backward()\n\nassert np.allclose((a.grad, b.grad), (3., 24.))\n```\n\n## What it's got\n\n### `torch_from_tensorflow`\n\nCreates a PyTorch function that is differentiable by evaluating a TensorFlow output tensor given input placeholders.\n\n### `eager_tensorflow_from_torch`\n\nCreates an eager Tensorflow function from a PyTorch function.\n\n### `tensorflow_from_torch`\n\nCreates a TensorFlow op/tensor from a PyTorch function.\n\n## Future work\n\n- [ ] support JAX\n- [ ] support higher-order derivatives\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/blackhc/tfpyth", "keywords": "ml machine learning", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "tfpyth", "package_url": "https://pypi.org/project/tfpyth/", "platform": "", "project_url": "https://pypi.org/project/tfpyth/", "project_urls": { "Homepage": "https://github.com/blackhc/tfpyth" }, "release_url": "https://pypi.org/project/tfpyth/1.0.1/", "requires_dist": [ "tensorflow (~=1.14)", "torch (~=1.1)", "check-manifest ; extra == 'dev'", "coverage ; extra == 'test'", "codecov ; extra == 'test'", "pytest ; extra == 'test'", "pytest-cov ; extra == 'test'" ], "requires_python": "", "summary": "Putting TensorFlow back in PyTorch, back in Tensorflow (differentiable TensorFlow PyTorch adapters).", "version": "1.0.1" }, "last_serial": 5513099, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "2bcecc99f6ac84824b3ffb903f98a9d8", "sha256": "c007737b4479291606f5578f379cda73156db674839f63c65ac0be58cd02cbf7" }, "downloads": -1, "filename": "tfpyth-1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "2bcecc99f6ac84824b3ffb903f98a9d8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3984, "upload_time": "2019-07-10T16:15:41", "url": "https://files.pythonhosted.org/packages/3e/17/15ec62f99cb4d8118a899f4b97d2574f67e9d71db4c0c9f40866f09a0e1f/tfpyth-1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d9cca5447a5d146fff407dece198df2e", "sha256": "80fbf7c5e7d6664d5a6ab7f3609fbe6f497b2663586d8500bf1cbe8b2b211994" }, "downloads": -1, "filename": "tfpyth-1.0.tar.gz", "has_sig": false, "md5_digest": "d9cca5447a5d146fff407dece198df2e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3742, "upload_time": "2019-07-10T16:15:43", "url": "https://files.pythonhosted.org/packages/a6/24/c2b6bc8b87d8afab7bdce80ff56fc62a928fc8614b2854d0553cd3543d18/tfpyth-1.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "6cda0cedd9c7d32be3966d3141dff934", "sha256": "8d402bf051edfc4ac2777ff6bb88b5daafb867cf98839937b39b987b21141466" }, "downloads": -1, "filename": "tfpyth-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "6cda0cedd9c7d32be3966d3141dff934", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4170, "upload_time": "2019-07-10T17:03:42", "url": "https://files.pythonhosted.org/packages/6d/6c/2adef3abd6923846b6557c13a9425f838aec05779541d14bf09c2118121c/tfpyth-1.0.1-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6cda0cedd9c7d32be3966d3141dff934", "sha256": "8d402bf051edfc4ac2777ff6bb88b5daafb867cf98839937b39b987b21141466" }, "downloads": -1, "filename": "tfpyth-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "6cda0cedd9c7d32be3966d3141dff934", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4170, "upload_time": "2019-07-10T17:03:42", "url": "https://files.pythonhosted.org/packages/6d/6c/2adef3abd6923846b6557c13a9425f838aec05779541d14bf09c2118121c/tfpyth-1.0.1-py3-none-any.whl" } ] }