{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/tf-coder-program-synthesis-for-tensor","title":"TF-Coder: Program Synthesis for Tensor Manipulations","arxiv_id":"2003.09040","date":"2020-03-19","proceeding":"NeurIPS Workshop CAP 2020 12","authors":["Kensen Shi","David Bieber","Rishabh Singh"],"abstract":"The success and popularity of deep learning is on the rise, partially due to powerful deep learning frameworks such as TensorFlow and PyTorch that make it easier to develop deep learning models. However, these libraries also come with steep learning curves, since programming in these frameworks is quite different from traditional imperative programming with explicit loops and conditionals. In this work, we present a tool called TF-Coder for programming by example in TensorFlow. TF-Coder uses a bottom-up weighted enumerative search, with value-based pruning of equivalent expressions and flexible type- and value-based filtering to ensure that expressions adhere to various requirements imposed by the TensorFlow library. We train models to predict TensorFlow operations from features of the input and output tensors and natural language descriptions of tasks, to prioritize relevant operations during search. TF-Coder solves 63 of 70 real-world tasks within 5 minutes, sometimes finding simpler solutions in less time compared to experienced human programmers.","url_abs":"https://arxiv.org/abs/2003.09040v4","url_pdf":"https://arxiv.org/pdf/2003.09040v4.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"tf-coder-program-synthesis-for-tensor","repo_url":"https://github.com/google-research/tensorflow-coder","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"tf-coder-program-synthesis-for-tensor","repo_url":"https://github.com/grwlf/galaxy-lang","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"tf","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"deep-learning","task_name":"Deep Learning"},{"task_slug":"enumerative-search","task_name":"Enumerative Search"},{"task_slug":"program-synthesis","task_name":"Program Synthesis"}],"methods":[{"method_slug":"pruning","method_name":"Pruning"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2003.09040","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2003.09040"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/grwlf/galaxy-lang","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/google-research/tensorflow-coder","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"unverified":14},"by_repo_kind":{"official":{"samples":8,"ran":0,"repositories":1},"listed":{"samples":6,"ran":0,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"3f4d2d582062c028","entry":"convert_to_tensor","repo":"google-research/tensorflow-coder","repo_kind":"official","path":"tf_coder/tf_coder_utils.py","file_url":"https://github.com/google-research/tensorflow-coder/blob/HEAD/tf_coder/tf_coder_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"3f4d2d582062c028"}},{"code_sha256_prefix":"e5a418212e1a1f5b","entry":"get_model","repo":"google-research/tensorflow-coder","repo_kind":"official","path":"tf_coder/models/tensor_features_model.py","file_url":"https://github.com/google-research/tensorflow-coder/blob/HEAD/tf_coder/models/tensor_features_model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e5a418212e1a1f5b"}},{"code_sha256_prefix":"5bb98767d8fda208","entry":"get_tf_function","repo":"google-research/tensorflow-coder","repo_kind":"official","path":"tf_coder/tf_coder_utils.py","file_url":"https://github.com/google-research/tensorflow-coder/blob/HEAD/tf_coder/tf_coder_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5bb98767d8fda208"}},{"code_sha256_prefix":"438f09dc53707971","entry":"ignore","repo":"google-research/tensorflow-coder","repo_kind":"official","path":"tf_coder/benchmarks/benchmark.py","file_url":"https://github.com/google-research/tensorflow-coder/blob/HEAD/tf_coder/benchmarks/benchmark.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"438f09dc53707971"}},{"code_sha256_prefix":"2c63d1e3ef45d825","entry":"isref","repo":"grwlf/galaxy-lang","repo_kind":"listed","path":"graveyard/src/galang/lang.py","file_url":"https://github.com/grwlf/galaxy-lang/blob/HEAD/graveyard/src/galang/lang.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2c63d1e3ef45d825"}},{"code_sha256_prefix":"a96993f78c769fb4","entry":"isterm","repo":"grwlf/galaxy-lang","repo_kind":"listed","path":"graveyard/src/galang/lang.py","file_url":"https://github.com/grwlf/galaxy-lang/blob/HEAD/graveyard/src/galang/lang.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a96993f78c769fb4"}},{"code_sha256_prefix":"71458c45ce0b2969","entry":"mkname","repo":"grwlf/galaxy-lang","repo_kind":"listed","path":"src/galang/edsl.py","file_url":"https://github.com/grwlf/galaxy-lang/blob/HEAD/src/galang/edsl.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"71458c45ce0b2969"}},{"code_sha256_prefix":"b92eabdc465292f2","entry":"mkterm","repo":"grwlf/galaxy-lang","repo_kind":"listed","path":"graveyard/src/galang/lang.py","file_url":"https://github.com/grwlf/galaxy-lang/blob/HEAD/graveyard/src/galang/lang.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b92eabdc465292f2"}},{"code_sha256_prefix":"d63ee67ff03ddb40","entry":"mkterm","repo":"grwlf/galaxy-lang","repo_kind":"listed","path":"graveyard/src/solution/lang.py","file_url":"https://github.com/grwlf/galaxy-lang/blob/HEAD/graveyard/src/solution/lang.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d63ee67ff03ddb40"}},{"code_sha256_prefix":"2a387f7c2d6d3940","entry":"num_tensor_elements","repo":"google-research/tensorflow-coder","repo_kind":"official","path":"tf_coder/tf_coder_utils.py","file_url":"https://github.com/google-research/tensorflow-coder/blob/HEAD/tf_coder/tf_coder_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2a387f7c2d6d3940"}},{"code_sha256_prefix":"96d83889ae3ee17c","entry":"parse","repo":"google-research/tensorflow-coder","repo_kind":"official","path":"tf_coder_colab_logging/serialization.py","file_url":"https://github.com/google-research/tensorflow-coder/blob/HEAD/tf_coder_colab_logging/serialization.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"96d83889ae3ee17c"}},{"code_sha256_prefix":"c1fbb742c7172e0f","entry":"parse_function_info_name","repo":"google-research/tensorflow-coder","repo_kind":"official","path":"tf_coder/tf_functions.py","file_url":"https://github.com/google-research/tensorflow-coder/blob/HEAD/tf_coder/tf_functions.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"c1fbb742c7172e0f"}},{"code_sha256_prefix":"40fe88a021d3c23b","entry":"permute","repo":"grwlf/galaxy-lang","repo_kind":"listed","path":"src/galang/gen.py","file_url":"https://github.com/grwlf/galaxy-lang/blob/HEAD/src/galang/gen.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"40fe88a021d3c23b"}},{"code_sha256_prefix":"6363dbc5c6d4760f","entry":"serialize","repo":"google-research/tensorflow-coder","repo_kind":"official","path":"tf_coder_colab_logging/serialization.py","file_url":"https://github.com/google-research/tensorflow-coder/blob/HEAD/tf_coder_colab_logging/serialization.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"6363dbc5c6d4760f"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}