{"about":{"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.","site":"https://codewithpapers.app","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","syntology":{"site":"https://syntology.ai","developers":"https://syntology.ai/developers","mcp":{"server":"https://syntology.ai/mcp","transport":"streamable-http","server_card":"https://syntology.ai/.well-known/mcp/server-card.json","auth":{"type":"trial token, no account","trial_token":"https://syntology.ai/api/oauth/trial/token","method":"POST","docs":"https://syntology.ai/developers"}},"have":"https://syntology.ai/api/graph/have?x=<method, arXiv id or title> (free, answers coverage only)","paper_base":"https://syntology.ai/paper/","atlas_base":"https://app.syntology.ai/?focus="},"machine_readable":[{"url":"https://codewithpapers.app/llms.txt","what":"the machine catalog: every machine-readable file, counted"},{"url":"https://codewithpapers.app/index/manifest.json","what":"paper-to-code index by arXiv id, with Syntology's counts"},{"url":"https://codewithpapers.app/search/manifest.json","what":"site search index (titles, authors) and its files"},{"url":"https://codewithpapers.app/download","what":"bulk files: Syntology's layer, described there"},{"url":"https://codewithpapers.app/build_manifest.json","what":"the build record: inputs, counts, exclusions, probes"}]},"url":"/paper/automatic-differentiation-for-tensor-algebras","title":"Automatic Differentiation for Tensor Algebras","arxiv_id":"1711.01348","date":"2017-11-03","proceeding":null,"authors":["Sebastian Urban","Patrick van der Smagt"],"abstract":"Kjolstad et. al. proposed a tensor algebra compiler. It takes expressions\nthat define a tensor element-wise, such as $f_{ij}(a,b,c,d) =\n\\exp\\left[-\\sum_{k=0}^4 \\left((a_{ik}+b_{jk})^2\\, c_{ii} + d_{i+k}^3 \\right)\n\\right]$, and generates the corresponding compute kernel code.\n  For machine learning, especially deep learning, it is often necessary to\ncompute the gradient of a loss function $l(a,b,c,d)=l(f(a,b,c,d))$ with respect\nto parameters $a,b,c,d$. If tensor compilers are to be applied in this field,\nit is necessary to derive expressions for the derivatives of element-wise\ndefined tensors, i.e. expressions for $(da)_{ik}=\\partial l/\\partial a_{ik}$.\n  When the mapping between function indices and argument indices is not 1:1,\nspecial attention is required. For the function $f_{ij} (x) = x_i^2$, the\nderivative of the loss is $(dx)_i=\\partial l/\\partial x_i=\\sum_j\n(df)_{ij}2x_i$; the sum is necessary because index $j$ does not appear in the\nindices of $f$. Another example is $f_{i}(x)=x_{ii}^2$, where $x$ is a matrix;\nhere we have $(dx)_{ij}=\\delta_{ij}(df)_i2x_{ii}$; the Kronecker delta is\nnecessary because the derivative is zero for off-diagonal elements. Another\nindexing scheme is used by $f_{ij}(x)=\\exp x_{i+j}$; here the correct\nderivative is $(dx)_{k}=\\sum_i (df)_{i,k-i} \\exp x_{k}$, where the range of the\nsum must be chosen appropriately.\n  In this publication we present an algorithm that can handle any case in which\nthe indices of an argument are an arbitrary linear combination of the indices\nof the function, thus all the above examples can be handled. Sums (and their\nranges) and Kronecker deltas are automatically inserted into the derivatives as\nnecessary. Additionally, the indices are transformed, if required (as in the\nlast example). The algorithm outputs a symbolic expression that can be\nsubsequently fed into a tensor algebra compiler.\n  Source code is provided.","url_abs":"http://arxiv.org/abs/1711.01348v1","url_pdf":"http://arxiv.org/pdf/1711.01348v1.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":"automatic-differentiation-for-tensor-algebras","repo_url":"https://github.com/surban/TensorAlgDiff","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"none","reach":null},{"paper_slug":"automatic-differentiation-for-tensor-algebras","repo_url":"https://github.com/Arima-Kawori/CPProject","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"automatic-differentiation-for-tensor-algebras","repo_url":"https://github.com/Ir1d/CompilerProject","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"automatic-differentiation-for-tensor-algebras","repo_url":"https://github.com/NeverGiveUuuuuuup/Compiler_Project","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"automatic-differentiation-for-tensor-algebras","repo_url":"https://github.com/beizai/CompilerProject2","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"automatic-differentiation-for-tensor-algebras","repo_url":"https://github.com/bling666/CompilerProject-2020Spring","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"automatic-differentiation-for-tensor-algebras","repo_url":"https://github.com/gosicksky/CompilerPorject","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"automatic-differentiation-for-tensor-algebras","repo_url":"https://github.com/guoyuqi020/CompilerProject","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"automatic-differentiation-for-tensor-algebras","repo_url":"https://github.com/gurry30/compiler","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"automatic-differentiation-for-tensor-algebras","repo_url":"https://github.com/handar423/project2","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"automatic-differentiation-for-tensor-algebras","repo_url":"https://github.com/hzw649/CompilerProject-Part1","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"automatic-differentiation-for-tensor-algebras","repo_url":"https://github.com/idodra/Compile-project","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"automatic-differentiation-for-tensor-algebras","repo_url":"https://github.com/magic3007/AutoGrad","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"automatic-differentiation-for-tensor-algebras","repo_url":"https://github.com/natianxing/CompilerProject","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"automatic-differentiation-for-tensor-algebras","repo_url":"https://github.com/pku-compiler-design-spring/CompilerProject-2020Spring","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"automatic-differentiation-for-tensor-algebras","repo_url":"https://github.com/quackson/Project2","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"automatic-differentiation-for-tensor-algebras","repo_url":"https://github.com/shibizhao/compiler_proj_final","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"automatic-differentiation-for-tensor-algebras","repo_url":"https://github.com/xjc-kk/CompilerProject","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"tensor-algebra","task_name":"tensor algebra"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":null,"mcp":null,"developers":"https://syntology.ai/developers","held":null,"reason":"arxiv_id_not_in_atlas","checked_against":{"atlas_ids":549449,"atlas_ids_sha256":"afd72399dafd9906e9062927f70655952385a3d75488558e1f0484e950ab09b7","read_at":"2026-10-05T01:46:21Z"},"by_repo":[{"repo":"surban/TensorAlgDiff","kind":"official","samples":0,"ran":0,"instrument":0,"unverified":0},{"repo":"Arima-Kawori/CPProject","kind":"listed","samples":0,"ran":0,"instrument":0,"unverified":0},{"repo":"Ir1d/CompilerProject","kind":"listed","samples":0,"ran":0,"instrument":0,"unverified":0},{"repo":"NeverGiveUuuuuuup/Compiler_Project","kind":"listed","samples":0,"ran":0,"instrument":0,"unverified":0},{"repo":"beizai/CompilerProject2","kind":"listed","samples":0,"ran":0,"instrument":0,"unverified":0},{"repo":"bling666/CompilerProject-2020Spring","kind":"listed","samples":0,"ran":0,"instrument":0,"unverified":0},{"repo":"gosicksky/CompilerPorject","kind":"listed","samples":0,"ran":0,"instrument":0,"unverified":0},{"repo":"guoyuqi020/CompilerProject","kind":"listed","samples":0,"ran":0,"instrument":0,"unverified":0},{"repo":"gurry30/compiler","kind":"listed","samples":0,"ran":0,"instrument":0,"unverified":0},{"repo":"handar423/project2","kind":"listed","samples":0,"ran":0,"instrument":0,"unverified":0},{"repo":"hzw649/CompilerProject-Part1","kind":"listed","samples":0,"ran":0,"instrument":0,"unverified":0},{"repo":"idodra/Compile-project","kind":"listed","samples":0,"ran":0,"instrument":0,"unverified":0},{"repo":"magic3007/AutoGrad","kind":"listed","samples":0,"ran":0,"instrument":0,"unverified":0},{"repo":"natianxing/CompilerProject","kind":"listed","samples":0,"ran":0,"instrument":0,"unverified":0},{"repo":"pku-compiler-design-spring/CompilerProject-2020Spring","kind":"listed","samples":0,"ran":0,"instrument":0,"unverified":0},{"repo":"quackson/Project2","kind":"listed","samples":0,"ran":0,"instrument":0,"unverified":0},{"repo":"shibizhao/compiler_proj_final","kind":"listed","samples":0,"ran":0,"instrument":0,"unverified":0},{"repo":"xjc-kk/CompilerProject","kind":"listed","samples":0,"ran":0,"instrument":0,"unverified":0}],"by_repo_is":"one row per repository in the archive's code links, Syntology's graph links or the samples; samples 0 means no sample is linked to this paper, a statement about Syntology's coverage, not about the repository: with harvested_for_other_papers present, Syntology harvested the repository for that many other papers, and without it, Syntology harvested nothing from it; placed_by_identical_code counts samples whose link records no repository, placed here because identical code was harvested from this repository for another paper; ran counts executions on a synthesized input and instrument counts failures of Syntology's instrument, not of the code"},"code_links_note":null,"arxiv_metadata":null,"syntology_extracted_results":null,"record_sha256":"17129c0bb2ab6adfe764165508a3b9fefcda60df67823786ad87b4bd3c38cfd0","record_changed_at":"2026-09-28","record_changed_at_basis":"first_hashed"}