@swiftbrowser/wasm-sdk 0.0.0-stage → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +1445 -0
- package/README.md +24 -2
- package/files.json +631 -0
- package/package.json +18 -4
- package/wasm32-unknown-wasip1/WASI.sdk/bin/xml2-config +108 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__errno.h +15 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__errno_values.h +84 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__fd_set.h +67 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__function___isatty.h +14 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__functions_malloc.h +29 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__functions_memcpy.h +24 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__header_dirent.h +44 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__header_fcntl.h +60 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__header_inttypes.h +184 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__header_netinet_in.h +32 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__header_poll.h +33 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__header_stdlib.h +21 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__header_string.h +26 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__header_sys_ioctl.h +17 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__header_sys_resource.h +19 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__header_sys_socket.h +81 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__header_sys_stat.h +15 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__header_time.h +31 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__header_unistd.h +29 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__macro_FD_SETSIZE.h +6 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__macro_PAGESIZE.h +24 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__mode_t.h +38 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__seek.h +8 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__struct_dirent.h +14 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__struct_in6_addr.h +8 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__struct_in_addr.h +10 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__struct_iovec.h +12 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__struct_msghdr.h +16 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__struct_pollfd.h +10 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__struct_rusage.h +12 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__struct_sockaddr.h +11 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__struct_sockaddr_in.h +14 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__struct_sockaddr_in6.h +16 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__struct_sockaddr_storage.h +11 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__struct_sockaddr_un.h +10 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__struct_stat.h +35 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__struct_timespec.h +12 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__struct_timeval.h +13 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__struct_tm.h +19 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__struct_tms.h +13 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_DIR.h +6 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_blkcnt_t.h +7 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_blksize_t.h +6 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_clock_t.h +7 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_clockid_t.h +6 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_dev_t.h +7 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_fd_set.h +14 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_gid_t.h +6 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_in_addr_t.h +6 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_in_port_t.h +6 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_ino_t.h +7 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_mode_t.h +6 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_nfds_t.h +6 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_nlink_t.h +7 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_off_t.h +7 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_sa_family_t.h +6 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_sigset_t.h +7 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_socklen_t.h +6 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_ssize_t.h +7 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_suseconds_t.h +8 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_time_t.h +7 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_uid_t.h +6 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/alloca.h +19 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/ar.h +25 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/arpa/ftp.h +35 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/arpa/inet.h +31 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/arpa/nameser.h +526 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/arpa/nameser_compat.h +2 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/arpa/telnet.h +251 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/arpa/tftp.h +31 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/assert.h +23 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/alltypes.h +460 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/dirent.h +1 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/fcntl.h +1 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/fenv.h +10 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/float.h +16 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/hwcap.h +0 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/io.h +0 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/ioctl.h +1 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/ioctl_fix.h +0 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/ipcstat.h +1 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/limits.h +1 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/mman.h +0 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/poll.h +0 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/posix.h +2 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/reg.h +2 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/resource.h +0 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/setjmp.h +1 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/signal.h +40 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/socket.h +0 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/stat.h +1 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/stdint.h +20 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/byteswap.h +26 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/complex.h +143 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/cpio.h +29 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/crypt.h +20 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/ctype.h +77 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/dirent.h +89 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/dlfcn.h +56 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/endian.h +80 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/err.h +25 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/errno.h +32 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/fcntl.h +250 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/features.h +40 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/fenv.h +28 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/float.h +56 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/fmtmsg.h +47 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/fnmatch.h +24 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/fts.h +155 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/ftw.h +45 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/getopt.h +30 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/glob.h +54 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/iconv.h +24 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/ifaddrs.h +35 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/inttypes.h +233 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/iso646.h +20 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/langinfo.h +98 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/libgen.h +15 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/limits.h +178 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/locale.h +93 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/malloc.h +33 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/math.h +459 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/memory.h +1 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/monetary.h +23 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/mqueue.h +41 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/netinet/icmp6.h +305 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/netinet/igmp.h +45 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/netinet/in.h +433 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/netinet/in_systm.h +9 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/netinet/ip.h +199 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/netinet/ip6.h +141 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/netinet/ip_icmp.h +193 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/netinet/tcp.h +305 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/netinet/udp.h +46 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/netpacket/packet.h +62 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/nl_types.h +22 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/poll.h +69 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/pthread.h +267 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/regex.h +62 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sched.h +152 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/search.h +63 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/semaphore.h +39 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/setjmp.h +55 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/signal.h +339 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/stdalign.h +20 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/stdbool.h +14 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/stdc-predef.h +18 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/stdint.h +117 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/stdio.h +254 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/stdio_ext.h +34 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/stdlib.h +217 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/stdnoreturn.h +7 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/string.h +123 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/strings.h +40 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/stropts.h +139 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/dir.h +2 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/errno.h +2 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/eventfd.h +26 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/fcntl.h +2 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/file.h +21 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/ioctl.h +124 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/mman.h +157 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/param.h +37 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/poll.h +2 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/random.h +27 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/reg.h +9 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/resource.h +126 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/select.h +54 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/signal.h +2 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/socket.h +454 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/stat.h +198 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/statvfs.h +57 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/stropts.h +1 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/syscall.h +10 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/sysinfo.h +36 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/time.h +84 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/timeb.h +28 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/times.h +34 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/timex.h +103 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/ttydefaults.h +34 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/types.h +85 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/uio.h +57 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/un.h +39 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/utsname.h +29 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/syscall.h +1 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sysexits.h +21 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/tar.h +33 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/tgmath.h +270 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/threads.h +93 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/time.h +204 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/uchar.h +29 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/unistd.h +589 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/utime.h +29 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/values.h +39 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/wasi/api.h +34 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/wasi/libc-busywait.h +15 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/wasi/libc-environ.h +36 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/wasi/libc-find-relpath.h +75 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/wasi/libc-nocwd.h +61 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/wasi/libc.h +84 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/wasi/version.h +17 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/wasi/wasip1.h +2130 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/wasi/wasip2.h +10 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/wasi/wasip3.h +10 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/wchar.h +214 -0
- package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/wctype.h +79 -0
- package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/cmake/libxml2-2.11.5/libxml2-config-version.cmake +83 -0
- package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/cmake/libxml2-2.11.5/libxml2-config.cmake +160 -0
- package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/cmake/libxml2-2.11.5/libxml2-export-release.cmake +19 -0
- package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/cmake/libxml2-2.11.5/libxml2-export.cmake +108 -0
- package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/crt1-command.o +0 -0
- package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/crt1-reactor.o +0 -0
- package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/crt1.o +0 -0
- package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libc++.a +0 -0
- package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libc++.modules.json +26 -0
- package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libc++abi.a +0 -0
- package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libc++experimental.a +0 -0
- package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libc-printscan-long-double.a +0 -0
- package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libc-printscan-no-floating-point.a +0 -0
- package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libc.a +0 -0
- package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libc.so +0 -0
- package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libcrypt.a +1 -0
- package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libdl.a +0 -0
- package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libdl.so +0 -0
- package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libm.a +1 -0
- package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libpthread.a +1 -0
- package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libresolv.a +1 -0
- package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/librt.a +1 -0
- package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libsetjmp.a +0 -0
- package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libsetjmp.so +0 -0
- package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libutil.a +1 -0
- package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libwasi-emulated-getpid.a +0 -0
- package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libwasi-emulated-getpid.so +0 -0
- package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libwasi-emulated-mman.a +0 -0
- package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libwasi-emulated-mman.so +0 -0
- package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libwasi-emulated-process-clocks.a +0 -0
- package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libwasi-emulated-process-clocks.so +0 -0
- package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libwasi-emulated-signal.a +0 -0
- package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libwasi-emulated-signal.so +0 -0
- package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libxml2.a +0 -0
- package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libxnet.a +1 -0
- package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/pkgconfig/libxml-2.0.pc +13 -0
- package/wasm32-unknown-wasip1/swift-sdk.json +13 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/clang/lib/wasip1/libclang_rt.builtins-wasm32.a +0 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/clang/lib/wasip1/libclang_rt.profile-wasm32.a +0 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/apinotes/SwiftWASILibc.apinotes +5 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__clang_cuda_builtin_vars.h +121 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__clang_cuda_cmath.h +512 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__clang_cuda_complex_builtins.h +285 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__clang_cuda_device_functions.h +1572 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__clang_cuda_intrinsics.h +994 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__clang_cuda_libdevice_declares.h +468 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__clang_cuda_math.h +353 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__clang_cuda_math_forward_declares.h +284 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__clang_cuda_runtime_wrapper.h +504 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__clang_cuda_texture_intrinsics.h +1177 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__clang_hip_cmath.h +848 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__clang_hip_libdevice_declares.h +345 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__clang_hip_math.h +1405 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__clang_hip_runtime_wrapper.h +162 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__clang_hip_stdlib.h +43 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__clang_spirv_builtins.h +217 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__float_float.h +165 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__float_header_macro.h +12 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__float_infinity_nan.h +20 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__stdarg___gnuc_va_list.h +13 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__stdarg___va_copy.h +12 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__stdarg_header_macro.h +12 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__stdarg_va_arg.h +22 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__stdarg_va_copy.h +12 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__stdarg_va_list.h +13 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__stddef_header_macro.h +12 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__stddef_max_align_t.h +27 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__stddef_null.h +29 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__stddef_nullptr_t.h +29 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__stddef_offsetof.h +17 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__stddef_ptrdiff_t.h +20 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__stddef_rsize_t.h +20 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__stddef_size_t.h +20 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__stddef_unreachable.h +21 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__stddef_wchar_t.h +28 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__stddef_wint_t.h +15 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__wmmintrin_aes.h +140 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__wmmintrin_pclmul.h +48 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/adcintrin.h +165 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/adxintrin.h +107 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/altivec.h +19364 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/amdgpuintrin.h +191 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/ammintrin.h +183 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/amxavx512intrin.h +382 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/amxbf16transposeintrin.h +94 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/amxcomplexintrin.h +167 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/amxcomplextransposeintrin.h +303 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/amxfp16intrin.h +93 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/amxfp16transposeintrin.h +94 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/amxfp8intrin.h +230 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/amxintrin.h +494 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/amxmovrsintrin.h +48 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/amxmovrstransposeintrin.h +200 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/amxtf32intrin.h +108 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/amxtf32transposeintrin.h +105 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/amxtransposeintrin.h +248 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/andes_vector.h +16 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/arm64intr.h +35 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/arm_acle.h +855 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/arm_bf16.h +20 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/arm_cde.h +410 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/arm_cmse.h +217 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/arm_fp16.h +596 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/arm_mve.h +19187 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/arm_neon.h +74047 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/arm_neon_sve_bridge.h +182 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/arm_sme.h +3741 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/arm_sve.h +31898 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/arm_vector_types.h +432 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/armintr.h +31 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/availability_domain.h +51 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx10_2_512bf16intrin.h +561 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx10_2_512convertintrin.h +322 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx10_2_512minmaxintrin.h +127 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx10_2_512niintrin.h +314 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx10_2_512satcvtdsintrin.h +307 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx10_2_512satcvtintrin.h +301 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx10_2bf16intrin.h +1085 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx10_2convertintrin.h +3257 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx10_2copyintrin.h +66 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx10_2minmaxintrin.h +232 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx10_2niintrin.h +409 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx10_2satcvtdsintrin.h +376 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx10_2satcvtintrin.h +312 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx2intrin.h +5293 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512bf16intrin.h +283 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512bitalgintrin.h +86 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512bwintrin.h +2014 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512cdintrin.h +125 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512dqintrin.h +1379 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512fintrin.h +9787 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512fp16intrin.h +3353 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512ifmaintrin.h +70 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512ifmavlintrin.h +111 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512vbmi2intrin.h +357 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512vbmiintrin.h +106 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512vbmivlintrin.h +193 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512vlbf16intrin.h +517 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512vlbitalgintrin.h +151 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512vlbwintrin.h +3167 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512vlcdintrin.h +230 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512vldqintrin.h +1173 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512vlfp16intrin.h +2071 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512vlintrin.h +8437 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512vlvbmi2intrin.h +695 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512vlvnniintrin.h +310 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512vlvp2intersectintrin.h +123 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512vnniintrin.h +116 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512vp2intersectintrin.h +78 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512vpopcntdqintrin.h +64 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512vpopcntdqvlintrin.h +103 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avxifmaintrin.h +177 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avxintrin.h +5140 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avxneconvertintrin.h +484 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avxvnniint16intrin.h +432 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avxvnniint8intrin.h +430 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avxvnniintrin.h +225 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/bmi2intrin.h +253 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/bmiintrin.h +604 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/bounds_safety_soft_traps.h +55 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/builtins.h +19 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/cet.h +66 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/cetintrin.h +115 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/cldemoteintrin.h +36 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/clflushoptintrin.h +36 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/clwbintrin.h +38 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/clzerointrin.h +38 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/cmpccxaddintrin.h +70 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/cpuid.h +354 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/crc32intrin.h +100 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/cuda_wrappers/bits/basic_string.h +9 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/cuda_wrappers/bits/c++config.h +61 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/cuda_wrappers/bits/shared_ptr_base.h +9 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/cuda_wrappers/cmath +44 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/emmintrin.h +4940 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/enqcmdintrin.h +63 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/f16cintrin.h +162 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/feature-availability.h +17 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/float.h +45 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/fma4intrin.h +218 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/fmaintrin.h +796 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/fuzzer/FuzzedDataProvider.h +397 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/fxsrintrin.h +91 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/gfniintrin.h +233 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/gpuintrin.h +328 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/hexagon_circ_brev_intrinsics.h +298 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/hexagon_protos.h +8439 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/hexagon_types.h +2625 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/hresetintrin.h +49 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/htmintrin.h +212 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/htmxlintrin.h +345 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/hvx_hexagon_protos.h +5610 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/ia32intrin.h +863 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/immintrin.h +607 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/intrin.h +487 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/intrin0.h +256 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/inttypes.h +101 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/invpcidintrin.h +23 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/iso646.h +31 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/keylockerintrin.h +518 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/larchintrin.h +260 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/lasxintrin.h +3886 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/lifetimebound.h +37 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/limits.h +133 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/llvm_libc_wrappers/assert.h +34 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/llvm_libc_wrappers/ctype.h +140 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/llvm_libc_wrappers/inttypes.h +34 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/llvm_libc_wrappers/stdio.h +80 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/llvm_libc_wrappers/stdlib.h +53 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/llvm_libc_wrappers/string.h +96 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/llvm_libc_wrappers/time.h +34 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/llvm_offload_wrappers/__llvm_offload.h +31 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/llvm_offload_wrappers/__llvm_offload_device.h +10 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/llvm_offload_wrappers/__llvm_offload_host.h +15 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/lsxintrin.h +3752 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/lwpintrin.h +136 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/lzcntintrin.h +109 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/mm3dnow.h +22 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/mm_malloc.h +67 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/mmintrin.h +1610 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/module.modulemap +393 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/movdirintrin.h +49 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/movrs_avx10_2_512intrin.h +98 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/movrs_avx10_2intrin.h +174 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/movrsintrin.h +59 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/msa.h +573 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/mwaitxintrin.h +62 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/nmmintrin.h +20 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/nvptxintrin.h +219 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/opencl-c-base.h +851 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/opencl-c.h +18630 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/openmp_wrappers/__clang_openmp_device_functions.h +104 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/openmp_wrappers/cmath +132 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/openmp_wrappers/complex.h +35 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/openmp_wrappers/complex_cmath.h +393 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/openmp_wrappers/math.h +61 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/orc/c_api.h +202 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/pconfigintrin.h +40 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/pkuintrin.h +34 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/pmmintrin.h +314 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/popcntintrin.h +59 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/ppc_wrappers/bmi2intrin.h +134 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/ppc_wrappers/bmiintrin.h +165 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/ppc_wrappers/emmintrin.h +2269 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/ppc_wrappers/immintrin.h +27 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/ppc_wrappers/mm_malloc.h +45 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/ppc_wrappers/mmintrin.h +1453 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/ppc_wrappers/nmmintrin.h +26 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/ppc_wrappers/pmmintrin.h +145 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/ppc_wrappers/smmintrin.h +683 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/ppc_wrappers/tmmintrin.h +453 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/ppc_wrappers/x86gprintrin.h +17 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/ppc_wrappers/x86intrin.h +28 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/ppc_wrappers/xmmintrin.h +1827 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/prfchiintrin.h +61 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/prfchwintrin.h +57 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/profile/instr_prof_interface.h +88 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/ptrauth.h +467 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/ptrcheck.h +339 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/ptwriteintrin.h +37 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/raointintrin.h +203 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/rdpruintrin.h +57 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/rdseedintrin.h +105 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/riscv_bitmanip.h +195 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/riscv_corev_alu.h +128 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/riscv_crypto.h +170 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/riscv_ntlh.h +26 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/riscv_vector.h +422 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/rtmintrin.h +45 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/s390intrin.h +25 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sanitizer/allocator_interface.h +106 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sanitizer/asan_interface.h +340 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sanitizer/common_interface_defs.h +492 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sanitizer/coverage_interface.h +36 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sanitizer/dfsan_interface.h +220 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sanitizer/hwasan_interface.h +109 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sanitizer/linux_syscall_hooks.h +3112 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sanitizer/lsan_interface.h +89 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sanitizer/memprof_interface.h +72 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sanitizer/msan_interface.h +135 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sanitizer/netbsd_syscall_hooks.h +5005 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sanitizer/rtsan_interface.h +75 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sanitizer/scudo_interface.h +38 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sanitizer/tsan_interface.h +316 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sanitizer/tsan_interface_atomic.h +223 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sanitizer/ubsan_interface.h +34 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/serializeintrin.h +30 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sgxintrin.h +60 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sha512intrin.h +200 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/shaintrin.h +190 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sifive_vector.h +118 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sm3intrin.h +238 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sm4evexintrin.h +32 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sm4intrin.h +269 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/smmintrin.h +2334 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/stdalign.h +24 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/stdarg.h +75 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/stdatomic.h +204 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/stdbool.h +39 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/stdckdint.h +42 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/stdcountof.h +15 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/stddef.h +144 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/stdint.h +844 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/stdnoreturn.h +35 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/tbmintrin.h +128 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/tgmath.h +1368 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/tmmintrin.h +810 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/tsxldtrkintrin.h +56 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/uintrintrin.h +157 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/unwind.h +332 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/usermsrintrin.h +51 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/vadefs.h +51 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/vaesintrin.h +87 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/varargs.h +16 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/vecintrin.h +12868 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/velintrin.h +71 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/velintrin_approx.h +120 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/velintrin_gen.h +1257 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/vpclmulqdqintrin.h +30 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/waitpkgintrin.h +42 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/wasm_simd128.h +2143 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/wbnoinvdintrin.h +24 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/wmmintrin.h +23 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/x86gprintrin.h +49 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/x86intrin.h +35 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/xmmintrin.h +3201 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/xopintrin.h +770 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/xray/xray_interface.h +178 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/xray/xray_log_interface.h +357 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/xray/xray_records.h +134 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/xsavecintrin.h +84 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/xsaveintrin.h +63 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/xsaveoptintrin.h +34 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/xsavesintrin.h +44 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/xtestintrin.h +27 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/yvals_core.h +25 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/zos_wrappers/builtins.h +18 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/lib/wasip1/libclang_rt.builtins-wasm32.a +0 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/lib/wasip1/libclang_rt.profile-wasm32.a +0 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/AssertionReporting.h +87 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/CoreFoundationShims.h +97 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/EmbeddedShims.h +277 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/FoundationShims.h +65 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/GlobalObjects.h +114 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/HeapObject.h +304 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/KeyPath.h +142 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/LibcOverlayShims.h +141 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/LibcShims.h +198 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/MetadataSections.h +100 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/ObjCShims.h +51 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/Random.h +43 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/RefCount.h +1654 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/Reflection.h +36 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/RuntimeShims.h +161 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/RuntimeStubs.h +61 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/SwiftStdbool.h +23 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/SwiftStddef.h +53 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/SwiftStdint.h +89 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/System.h +227 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/Target.h +45 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/ThreadLocalStorage.h +76 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/Visibility.h +312 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/_SwiftConcurrency.h +33 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/_SwiftDistributed.h +29 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/_SynchronizationShims.h +60 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/module.modulemap +39 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/Distributed.swiftmodule/wasm32-unknown-wasip1.private.swiftinterface +346 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/Distributed.swiftmodule/wasm32-unknown-wasip1.swiftinterface +346 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/Distributed.swiftmodule/wasm32-unknown-wasip1.swiftmodule +0 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/Observation.swiftmodule/wasm32-unknown-wasip1.private.swiftinterface +173 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/Observation.swiftmodule/wasm32-unknown-wasip1.swiftinterface +157 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/Observation.swiftmodule/wasm32-unknown-wasip1.swiftmodule +0 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/RegexBuilder.swiftmodule/wasm32-unknown-wasip1.private.swiftinterface +2961 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/RegexBuilder.swiftmodule/wasm32-unknown-wasip1.swiftinterface +2961 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/RegexBuilder.swiftmodule/wasm32-unknown-wasip1.swiftmodule +0 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/Swift.swiftmodule/wasm32-unknown-wasip1.private.swiftinterface +58665 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/Swift.swiftmodule/wasm32-unknown-wasip1.swiftinterface +57923 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/Swift.swiftmodule/wasm32-unknown-wasip1.swiftmodule +0 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/SwiftOnoneSupport.swiftmodule/wasm32-unknown-wasip1.private.swiftinterface +5 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/SwiftOnoneSupport.swiftmodule/wasm32-unknown-wasip1.swiftinterface +5 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/SwiftOnoneSupport.swiftmodule/wasm32-unknown-wasip1.swiftmodule +0 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/Synchronization.swiftmodule/wasm32-unknown-wasip1.private.swiftinterface +7122 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/Synchronization.swiftmodule/wasm32-unknown-wasip1.swiftinterface +7122 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/Synchronization.swiftmodule/wasm32-unknown-wasip1.swiftmodule +0 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/WASILibc.swiftmodule/wasm32-unknown-wasip1.private.swiftinterface +423 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/WASILibc.swiftmodule/wasm32-unknown-wasip1.swiftinterface +423 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/WASILibc.swiftmodule/wasm32-unknown-wasip1.swiftmodule +0 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/_Builtin_float.swiftmodule/wasm32-unknown-wasip1.private.swiftinterface +51 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/_Builtin_float.swiftmodule/wasm32-unknown-wasip1.swiftinterface +51 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/_Builtin_float.swiftmodule/wasm32-unknown-wasip1.swiftmodule +0 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/_Concurrency.swiftmodule/wasm32-unknown-wasip1.private.swiftinterface +7915 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/_Concurrency.swiftmodule/wasm32-unknown-wasip1.swiftinterface +7779 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/_Concurrency.swiftmodule/wasm32-unknown-wasip1.swiftmodule +0 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/_Differentiation.swiftmodule/wasm32-unknown-wasip1.private.swiftinterface +2257 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/_Differentiation.swiftmodule/wasm32-unknown-wasip1.swiftinterface +2257 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/_Differentiation.swiftmodule/wasm32-unknown-wasip1.swiftmodule +0 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/_RegexParser.swiftmodule/wasm32-unknown-wasip1.private.swiftinterface +2310 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/_RegexParser.swiftmodule/wasm32-unknown-wasip1.swiftinterface +2297 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/_RegexParser.swiftmodule/wasm32-unknown-wasip1.swiftmodule +0 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/_StringProcessing.swiftmodule/wasm32-unknown-wasip1.private.swiftinterface +573 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/_StringProcessing.swiftmodule/wasm32-unknown-wasip1.swiftinterface +372 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/_StringProcessing.swiftmodule/wasm32-unknown-wasip1.swiftmodule +0 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/_Volatile.swiftmodule/wasm32-unknown-wasip1.private.swiftinterface +46 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/_Volatile.swiftmodule/wasm32-unknown-wasip1.swiftinterface +46 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/_Volatile.swiftmodule/wasm32-unknown-wasip1.swiftmodule +0 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/libswiftCore.a +0 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/libswiftDistributed.a +0 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/libswiftObservation.a +0 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/libswiftRegexBuilder.a +0 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/libswiftSwiftOnoneSupport.a +0 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/libswiftSynchronization.a +0 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/libswiftWASILibc.a +0 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/libswift_Builtin_float.a +0 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/libswift_Concurrency.a +0 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/libswift_Differentiation.a +0 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/libswift_RegexParser.a +0 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/libswift_StringProcessing.a +0 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/libswift_Volatile.a +0 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/static-executable-args.lnk +10 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/wasm32/swiftrt.o +0 -0
- package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/wasm32/wasi-libc.modulemap +95 -0
- package/wasm32-unknown-wasip1/toolset.json +9 -0
|
@@ -0,0 +1,2257 @@
|
|
|
1
|
+
// swift-interface-format-version: 1.0
|
|
2
|
+
// swift-compiler-version: Swift version 6.4 (swift-6.4-RELEASE)
|
|
3
|
+
// swift-module-flags: -disable-objc-attr-requires-foundation-module -target wasm32-unknown-wasip1 -disable-objc-interop -enable-library-evolution -module-link-name swift_Differentiation -parse-stdlib -static -language-mode 5 -O -library-level api -enforce-exclusivity=unchecked -disable-objc-interop -target-min-inlining-version min -enable-experimental-feature SuppressedAssociatedTypesWithDefaults -enable-experimental-feature NonescapableTypes -enable-experimental-feature LifetimeDependence -enable-experimental-feature InoutLifetimeDependence -enable-experimental-feature LifetimeDependenceMutableAccessors -enable-experimental-feature Lifetimes -enable-upcoming-feature MemberImportVisibility -module-name _Differentiation
|
|
4
|
+
// swift-module-flags-ignorable: -enable-lexical-lifetimes=false -formal-cxx-interoperability-mode=off -interface-compiler-version 6.4
|
|
5
|
+
import Swift
|
|
6
|
+
import SwiftShims
|
|
7
|
+
import WASILibc
|
|
8
|
+
public protocol Differentiable {
|
|
9
|
+
associatedtype TangentVector : Swift::AdditiveArithmetic, _Differentiation::Differentiable where Self.TangentVector == Self.TangentVector.TangentVector
|
|
10
|
+
mutating func move(by offset: Self.TangentVector)
|
|
11
|
+
}
|
|
12
|
+
extension _Differentiation::Differentiable where Self == Self.TangentVector {
|
|
13
|
+
@_alwaysEmitIntoClient @inlinable public mutating func move(by offset: Self.TangentVector) {
|
|
14
|
+
self += offset
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
@inlinable public func valueWithDifferential<T, R>(at x: T, of f: @differentiable(reverse) (T) -> R) -> (value: R, differential: (T.TangentVector) -> R.TangentVector) where T : _Differentiation::Differentiable, R : _Differentiation::Differentiable {
|
|
18
|
+
return Builtin.applyDerivative_jvp(f, x)
|
|
19
|
+
}
|
|
20
|
+
@inlinable public func valueWithDifferential<T, U, R>(at x: T, _ y: U, of f: @differentiable(reverse) (T, U) -> R) -> (value: R, differential: (T.TangentVector, U.TangentVector) -> R.TangentVector) where T : _Differentiation::Differentiable, U : _Differentiation::Differentiable, R : _Differentiation::Differentiable {
|
|
21
|
+
return Builtin.applyDerivative_jvp_arity2(f, x, y)
|
|
22
|
+
}
|
|
23
|
+
@inlinable public func valueWithDifferential<T, U, V, R>(at x: T, _ y: U, _ z: V, of f: @differentiable(reverse) (T, U, V) -> R) -> (value: R, differential: (T.TangentVector, U.TangentVector, V.TangentVector) -> R.TangentVector) where T : _Differentiation::Differentiable, U : _Differentiation::Differentiable, V : _Differentiation::Differentiable, R : _Differentiation::Differentiable {
|
|
24
|
+
return Builtin.applyDerivative_jvp_arity3(f, x, y, z)
|
|
25
|
+
}
|
|
26
|
+
@inlinable public func valueWithDifferential<T, R, E>(at x: T, of f: @differentiable(reverse) (T) throws(E) -> R) throws(E) -> (value: R, differential: (T.TangentVector) -> R.TangentVector) where T : _Differentiation::Differentiable, R : _Differentiation::Differentiable, E : Swift::Error {
|
|
27
|
+
return try Builtin.applyDerivative_jvp_throws(f, x)
|
|
28
|
+
}
|
|
29
|
+
@inlinable public func valueWithDifferential<T, U, R, E>(at x: T, _ y: U, of f: @differentiable(reverse) (T, U) throws(E) -> R) throws(E) -> (value: R, differential: (T.TangentVector, U.TangentVector) -> R.TangentVector) where T : _Differentiation::Differentiable, U : _Differentiation::Differentiable, R : _Differentiation::Differentiable, E : Swift::Error {
|
|
30
|
+
return try Builtin.applyDerivative_jvp_arity2_throws(f, x, y)
|
|
31
|
+
}
|
|
32
|
+
@inlinable public func valueWithDifferential<T, U, V, R, E>(at x: T, _ y: U, _ z: V, of f: @differentiable(reverse) (T, U, V) throws(E) -> R) throws(E) -> (value: R, differential: (T.TangentVector, U.TangentVector, V.TangentVector) -> R.TangentVector) where T : _Differentiation::Differentiable, U : _Differentiation::Differentiable, V : _Differentiation::Differentiable, R : _Differentiation::Differentiable, E : Swift::Error {
|
|
33
|
+
return try Builtin.applyDerivative_jvp_arity3_throws(f, x, y, z)
|
|
34
|
+
}
|
|
35
|
+
@inlinable public func valueWithPullback<T, R>(at x: T, of f: @differentiable(reverse) (T) -> R) -> (value: R, pullback: (R.TangentVector) -> T.TangentVector) where T : _Differentiation::Differentiable, R : _Differentiation::Differentiable {
|
|
36
|
+
return Builtin.applyDerivative_vjp(f, x)
|
|
37
|
+
}
|
|
38
|
+
@inlinable public func valueWithPullback<T, U, R>(at x: T, _ y: U, of f: @differentiable(reverse) (T, U) -> R) -> (value: R, pullback: (R.TangentVector) -> (T.TangentVector, U.TangentVector)) where T : _Differentiation::Differentiable, U : _Differentiation::Differentiable, R : _Differentiation::Differentiable {
|
|
39
|
+
return Builtin.applyDerivative_vjp_arity2(f, x, y)
|
|
40
|
+
}
|
|
41
|
+
@inlinable public func valueWithPullback<T, U, V, R>(at x: T, _ y: U, _ z: V, of f: @differentiable(reverse) (T, U, V) -> R) -> (value: R, pullback: (R.TangentVector) -> (T.TangentVector, U.TangentVector, V.TangentVector)) where T : _Differentiation::Differentiable, U : _Differentiation::Differentiable, V : _Differentiation::Differentiable, R : _Differentiation::Differentiable {
|
|
42
|
+
return Builtin.applyDerivative_vjp_arity3(f, x, y, z)
|
|
43
|
+
}
|
|
44
|
+
@inlinable public func valueWithPullback<T, R, E>(at x: T, of f: @differentiable(reverse) (T) throws(E) -> R) throws(E) -> (value: R, pullback: (R.TangentVector) -> T.TangentVector) where T : _Differentiation::Differentiable, R : _Differentiation::Differentiable, E : Swift::Error {
|
|
45
|
+
return try Builtin.applyDerivative_vjp_throws(f, x)
|
|
46
|
+
}
|
|
47
|
+
@inlinable public func valueWithPullback<T, U, R, E>(at x: T, _ y: U, of f: @differentiable(reverse) (T, U) throws(E) -> R) throws(E) -> (value: R, pullback: (R.TangentVector) -> (T.TangentVector, U.TangentVector)) where T : _Differentiation::Differentiable, U : _Differentiation::Differentiable, R : _Differentiation::Differentiable, E : Swift::Error {
|
|
48
|
+
return try Builtin.applyDerivative_vjp_arity2_throws(f, x, y)
|
|
49
|
+
}
|
|
50
|
+
@inlinable public func valueWithPullback<T, U, V, R, E>(at x: T, _ y: U, _ z: V, of f: @differentiable(reverse) (T, U, V) throws(E) -> R) throws(E) -> (value: R, pullback: (R.TangentVector) -> (T.TangentVector, U.TangentVector, V.TangentVector)) where T : _Differentiation::Differentiable, U : _Differentiation::Differentiable, V : _Differentiation::Differentiable, R : _Differentiation::Differentiable, E : Swift::Error {
|
|
51
|
+
return try Builtin.applyDerivative_vjp_arity3_throws(f, x, y, z)
|
|
52
|
+
}
|
|
53
|
+
@inlinable public func differential<T, R>(at x: T, of f: @differentiable(reverse) (T) -> R) -> (T.TangentVector) -> R.TangentVector where T : _Differentiation::Differentiable, R : _Differentiation::Differentiable {
|
|
54
|
+
return valueWithDifferential(at: x, of: f).1
|
|
55
|
+
}
|
|
56
|
+
@inlinable public func differential<T, U, R>(at x: T, _ y: U, of f: @differentiable(reverse) (T, U) -> R) -> (T.TangentVector, U.TangentVector) -> R.TangentVector where T : _Differentiation::Differentiable, U : _Differentiation::Differentiable, R : _Differentiation::Differentiable {
|
|
57
|
+
return valueWithDifferential(at: x, y, of: f).1
|
|
58
|
+
}
|
|
59
|
+
@inlinable public func differential<T, U, V, R>(at x: T, _ y: U, _ z: V, of f: @differentiable(reverse) (T, U, V) -> R) -> (T.TangentVector, U.TangentVector, V.TangentVector) -> R.TangentVector where T : _Differentiation::Differentiable, U : _Differentiation::Differentiable, V : _Differentiation::Differentiable, R : _Differentiation::Differentiable {
|
|
60
|
+
return valueWithDifferential(at: x, y, z, of: f).1
|
|
61
|
+
}
|
|
62
|
+
@inlinable public func differential<T, R, E>(at x: T, of f: @differentiable(reverse) (T) throws(E) -> R) throws(E) -> (T.TangentVector) -> R.TangentVector where T : _Differentiation::Differentiable, R : _Differentiation::Differentiable, E : Swift::Error {
|
|
63
|
+
return try valueWithDifferential(at: x, of: f).1
|
|
64
|
+
}
|
|
65
|
+
@inlinable public func differential<T, U, R, E>(at x: T, _ y: U, of f: @differentiable(reverse) (T, U) throws(E) -> R) throws(E) -> (T.TangentVector, U.TangentVector) -> R.TangentVector where T : _Differentiation::Differentiable, U : _Differentiation::Differentiable, R : _Differentiation::Differentiable, E : Swift::Error {
|
|
66
|
+
return try valueWithDifferential(at: x, y, of: f).1
|
|
67
|
+
}
|
|
68
|
+
@inlinable public func differential<T, U, V, R, E>(at x: T, _ y: U, _ z: V, of f: @differentiable(reverse) (T, U, V) throws(E) -> R) throws(E) -> (T.TangentVector, U.TangentVector, V.TangentVector) -> R.TangentVector where T : _Differentiation::Differentiable, U : _Differentiation::Differentiable, V : _Differentiation::Differentiable, R : _Differentiation::Differentiable, E : Swift::Error {
|
|
69
|
+
return try valueWithDifferential(at: x, y, z, of: f).1
|
|
70
|
+
}
|
|
71
|
+
@inlinable public func pullback<T, R>(at x: T, of f: @differentiable(reverse) (T) -> R) -> (R.TangentVector) -> T.TangentVector where T : _Differentiation::Differentiable, R : _Differentiation::Differentiable {
|
|
72
|
+
return Builtin.applyDerivative_vjp(f, x).1
|
|
73
|
+
}
|
|
74
|
+
@inlinable public func pullback<T, U, R>(at x: T, _ y: U, of f: @differentiable(reverse) (T, U) -> R) -> (R.TangentVector) -> (T.TangentVector, U.TangentVector) where T : _Differentiation::Differentiable, U : _Differentiation::Differentiable, R : _Differentiation::Differentiable {
|
|
75
|
+
return Builtin.applyDerivative_vjp_arity2(f, x, y).1
|
|
76
|
+
}
|
|
77
|
+
@inlinable public func pullback<T, U, V, R>(at x: T, _ y: U, _ z: V, of f: @differentiable(reverse) (T, U, V) -> R) -> (R.TangentVector) -> (T.TangentVector, U.TangentVector, V.TangentVector) where T : _Differentiation::Differentiable, U : _Differentiation::Differentiable, V : _Differentiation::Differentiable, R : _Differentiation::Differentiable {
|
|
78
|
+
return Builtin.applyDerivative_vjp_arity3(f, x, y, z).1
|
|
79
|
+
}
|
|
80
|
+
@inlinable public func pullback<T, R, E>(at x: T, of f: @differentiable(reverse) (T) throws(E) -> R) throws(E) -> (R.TangentVector) -> T.TangentVector where T : _Differentiation::Differentiable, R : _Differentiation::Differentiable, E : Swift::Error {
|
|
81
|
+
return try Builtin.applyDerivative_vjp_throws(f, x).1
|
|
82
|
+
}
|
|
83
|
+
@inlinable public func pullback<T, U, R, E>(at x: T, _ y: U, of f: @differentiable(reverse) (T, U) throws(E) -> R) throws(E) -> (R.TangentVector) -> (T.TangentVector, U.TangentVector) where T : _Differentiation::Differentiable, U : _Differentiation::Differentiable, R : _Differentiation::Differentiable, E : Swift::Error {
|
|
84
|
+
return try Builtin.applyDerivative_vjp_arity2_throws(f, x, y).1
|
|
85
|
+
}
|
|
86
|
+
@inlinable public func pullback<T, U, V, R, E>(at x: T, _ y: U, _ z: V, of f: @differentiable(reverse) (T, U, V) throws(E) -> R) throws(E) -> (R.TangentVector) -> (T.TangentVector, U.TangentVector, V.TangentVector) where T : _Differentiation::Differentiable, U : _Differentiation::Differentiable, V : _Differentiation::Differentiable, R : _Differentiation::Differentiable, E : Swift::Error {
|
|
87
|
+
return try Builtin.applyDerivative_vjp_arity3_throws(f, x, y, z).1
|
|
88
|
+
}
|
|
89
|
+
@inlinable public func derivative<T, R>(at x: T, of f: @differentiable(reverse) (T) -> R) -> R.TangentVector where T : Swift::FloatingPoint, T : _Differentiation::Differentiable, T == T.TangentVector, R : _Differentiation::Differentiable {
|
|
90
|
+
return differential(at: x, of: f)(T(1))
|
|
91
|
+
}
|
|
92
|
+
@inlinable public func derivative<T, U, R>(at x: T, _ y: U, of f: @differentiable(reverse) (T, U) -> R) -> R.TangentVector where T : Swift::FloatingPoint, T : _Differentiation::Differentiable, T == T.TangentVector, U : Swift::FloatingPoint, U : _Differentiation::Differentiable, U == U.TangentVector, R : _Differentiation::Differentiable {
|
|
93
|
+
return differential(at: x, y, of: f)(T(1), U(1))
|
|
94
|
+
}
|
|
95
|
+
@inlinable public func derivative<T, U, V, R>(at x: T, _ y: U, _ z: V, of f: @differentiable(reverse) (T, U, V) -> R) -> R.TangentVector where T : Swift::FloatingPoint, T : _Differentiation::Differentiable, T == T.TangentVector, U : Swift::FloatingPoint, U : _Differentiation::Differentiable, U == U.TangentVector, V : Swift::FloatingPoint, V : _Differentiation::Differentiable, V == V.TangentVector, R : _Differentiation::Differentiable {
|
|
96
|
+
return differential(at: x, y, z, of: f)(T(1), U(1), V(1))
|
|
97
|
+
}
|
|
98
|
+
@inlinable public func derivative<T, R, E>(at x: T, of f: @differentiable(reverse) (T) throws(E) -> R) throws(E) -> R.TangentVector where T : Swift::FloatingPoint, T : _Differentiation::Differentiable, T == T.TangentVector, R : _Differentiation::Differentiable, E : Swift::Error {
|
|
99
|
+
return try differential(at: x, of: f)(T(1))
|
|
100
|
+
}
|
|
101
|
+
@inlinable public func derivative<T, U, R, E>(at x: T, _ y: U, of f: @differentiable(reverse) (T, U) throws(E) -> R) throws(E) -> R.TangentVector where T : Swift::FloatingPoint, T : _Differentiation::Differentiable, T == T.TangentVector, U : Swift::FloatingPoint, U : _Differentiation::Differentiable, U == U.TangentVector, R : _Differentiation::Differentiable, E : Swift::Error {
|
|
102
|
+
return try differential(at: x, y, of: f)(T(1), U(1))
|
|
103
|
+
}
|
|
104
|
+
@inlinable public func derivative<T, U, V, R, E>(at x: T, _ y: U, _ z: V, of f: @differentiable(reverse) (T, U, V) throws(E) -> R) throws(E) -> R.TangentVector where T : Swift::FloatingPoint, T : _Differentiation::Differentiable, T == T.TangentVector, U : Swift::FloatingPoint, U : _Differentiation::Differentiable, U == U.TangentVector, V : Swift::FloatingPoint, V : _Differentiation::Differentiable, V == V.TangentVector, R : _Differentiation::Differentiable, E : Swift::Error {
|
|
105
|
+
return try differential(at: x, y, z, of: f)(T(1), U(1), V(1))
|
|
106
|
+
}
|
|
107
|
+
@inlinable public func gradient<T, R>(at x: T, of f: @differentiable(reverse) (T) -> R) -> T.TangentVector where T : _Differentiation::Differentiable, R : Swift::FloatingPoint, R : _Differentiation::Differentiable, R == R.TangentVector {
|
|
108
|
+
return pullback(at: x, of: f)(R(1))
|
|
109
|
+
}
|
|
110
|
+
@inlinable public func gradient<T, U, R>(at x: T, _ y: U, of f: @differentiable(reverse) (T, U) -> R) -> (T.TangentVector, U.TangentVector) where T : _Differentiation::Differentiable, U : _Differentiation::Differentiable, R : Swift::FloatingPoint, R : _Differentiation::Differentiable, R == R.TangentVector {
|
|
111
|
+
return pullback(at: x, y, of: f)(R(1))
|
|
112
|
+
}
|
|
113
|
+
@inlinable public func gradient<T, U, V, R>(at x: T, _ y: U, _ z: V, of f: @differentiable(reverse) (T, U, V) -> R) -> (T.TangentVector, U.TangentVector, V.TangentVector) where T : _Differentiation::Differentiable, U : _Differentiation::Differentiable, V : _Differentiation::Differentiable, R : Swift::FloatingPoint, R : _Differentiation::Differentiable, R == R.TangentVector {
|
|
114
|
+
return pullback(at: x, y, z, of: f)(R(1))
|
|
115
|
+
}
|
|
116
|
+
@inlinable public func gradient<T, R, E>(at x: T, of f: @differentiable(reverse) (T) throws(E) -> R) throws(E) -> T.TangentVector where T : _Differentiation::Differentiable, R : Swift::FloatingPoint, R : _Differentiation::Differentiable, R == R.TangentVector, E : Swift::Error {
|
|
117
|
+
return try pullback(at: x, of: f)(R(1))
|
|
118
|
+
}
|
|
119
|
+
@inlinable public func gradient<T, U, R, E>(at x: T, _ y: U, of f: @differentiable(reverse) (T, U) throws(E) -> R) throws(E) -> (T.TangentVector, U.TangentVector) where T : _Differentiation::Differentiable, U : _Differentiation::Differentiable, R : Swift::FloatingPoint, R : _Differentiation::Differentiable, R == R.TangentVector, E : Swift::Error {
|
|
120
|
+
return try pullback(at: x, y, of: f)(R(1))
|
|
121
|
+
}
|
|
122
|
+
@inlinable public func gradient<T, U, V, R, E>(at x: T, _ y: U, _ z: V, of f: @differentiable(reverse) (T, U, V) throws(E) -> R) throws(E) -> (T.TangentVector, U.TangentVector, V.TangentVector) where T : _Differentiation::Differentiable, U : _Differentiation::Differentiable, V : _Differentiation::Differentiable, R : Swift::FloatingPoint, R : _Differentiation::Differentiable, R == R.TangentVector, E : Swift::Error {
|
|
123
|
+
return try pullback(at: x, y, z, of: f)(R(1))
|
|
124
|
+
}
|
|
125
|
+
@inlinable public func valueWithDerivative<T, R>(at x: T, of f: @escaping @differentiable(reverse) (T) -> R) -> (value: R, derivative: R.TangentVector) where T : Swift::FloatingPoint, T : _Differentiation::Differentiable, T == T.TangentVector, R : _Differentiation::Differentiable {
|
|
126
|
+
let (y, differential) = valueWithDifferential(at: x, of: f)
|
|
127
|
+
return (y, differential(T(1)))
|
|
128
|
+
}
|
|
129
|
+
@inlinable public func valueWithDerivative<T, U, R>(at x: T, _ y: U, of f: @escaping @differentiable(reverse) (T, U) -> R) -> (value: R, derivative: R.TangentVector) where T : Swift::FloatingPoint, T : _Differentiation::Differentiable, T == T.TangentVector, U : Swift::FloatingPoint, U : _Differentiation::Differentiable, U == U.TangentVector, R : _Differentiation::Differentiable {
|
|
130
|
+
let (y, differential) = valueWithDifferential(at: x, y, of: f)
|
|
131
|
+
return (y, differential(T(1), U(1)))
|
|
132
|
+
}
|
|
133
|
+
@inlinable public func valueWithDerivative<T, U, V, R>(at x: T, _ y: U, _ z: V, of f: @escaping @differentiable(reverse) (T, U, V) -> R) -> (value: R, derivative: R.TangentVector) where T : Swift::FloatingPoint, T : _Differentiation::Differentiable, T == T.TangentVector, U : Swift::FloatingPoint, U : _Differentiation::Differentiable, U == U.TangentVector, V : Swift::FloatingPoint, V : _Differentiation::Differentiable, V == V.TangentVector, R : _Differentiation::Differentiable {
|
|
134
|
+
let (y, differential) = valueWithDifferential(at: x, y, z, of: f)
|
|
135
|
+
return (y, differential(T(1), U(1), V(1)))
|
|
136
|
+
}
|
|
137
|
+
@inlinable public func valueWithDerivative<T, R, E>(at x: T, of f: @escaping @differentiable(reverse) (T) throws(E) -> R) throws(E) -> (value: R, derivative: R.TangentVector) where T : Swift::FloatingPoint, T : _Differentiation::Differentiable, T == T.TangentVector, R : _Differentiation::Differentiable, E : Swift::Error {
|
|
138
|
+
let (y, differential) = try valueWithDifferential(at: x, of: f)
|
|
139
|
+
return (y, differential(T(1)))
|
|
140
|
+
}
|
|
141
|
+
@inlinable public func valueWithDerivative<T, U, R, E>(at x: T, _ y: U, of f: @escaping @differentiable(reverse) (T, U) throws(E) -> R) throws(E) -> (value: R, derivative: R.TangentVector) where T : Swift::FloatingPoint, T : _Differentiation::Differentiable, T == T.TangentVector, U : Swift::FloatingPoint, U : _Differentiation::Differentiable, U == U.TangentVector, R : _Differentiation::Differentiable, E : Swift::Error {
|
|
142
|
+
let (y, differential) = try valueWithDifferential(at: x, y, of: f)
|
|
143
|
+
return (y, differential(T(1), U(1)))
|
|
144
|
+
}
|
|
145
|
+
@inlinable public func valueWithDerivative<T, U, V, R, E>(at x: T, _ y: U, _ z: V, of f: @escaping @differentiable(reverse) (T, U, V) throws(E) -> R) throws(E) -> (value: R, derivative: R.TangentVector) where T : Swift::FloatingPoint, T : _Differentiation::Differentiable, T == T.TangentVector, U : Swift::FloatingPoint, U : _Differentiation::Differentiable, U == U.TangentVector, V : Swift::FloatingPoint, V : _Differentiation::Differentiable, V == V.TangentVector, R : _Differentiation::Differentiable, E : Swift::Error {
|
|
146
|
+
let (y, differential) = try valueWithDifferential(at: x, y, z, of: f)
|
|
147
|
+
return (y, differential(T(1), U(1), V(1)))
|
|
148
|
+
}
|
|
149
|
+
@inlinable public func valueWithGradient<T, R>(at x: T, of f: @differentiable(reverse) (T) -> R) -> (value: R, gradient: T.TangentVector) where T : _Differentiation::Differentiable, R : Swift::FloatingPoint, R : _Differentiation::Differentiable, R == R.TangentVector {
|
|
150
|
+
let (y, pullback) = valueWithPullback(at: x, of: f)
|
|
151
|
+
return (y, pullback(R(1)))
|
|
152
|
+
}
|
|
153
|
+
@inlinable public func valueWithGradient<T, U, R>(at x: T, _ y: U, of f: @differentiable(reverse) (T, U) -> R) -> (value: R, gradient: (T.TangentVector, U.TangentVector)) where T : _Differentiation::Differentiable, U : _Differentiation::Differentiable, R : Swift::FloatingPoint, R : _Differentiation::Differentiable, R == R.TangentVector {
|
|
154
|
+
let (y, pullback) = valueWithPullback(at: x, y, of: f)
|
|
155
|
+
return (y, pullback(R(1)))
|
|
156
|
+
}
|
|
157
|
+
@inlinable public func valueWithGradient<T, U, V, R>(at x: T, _ y: U, _ z: V, of f: @differentiable(reverse) (T, U, V) -> R) -> (value: R, gradient: (T.TangentVector, U.TangentVector, V.TangentVector)) where T : _Differentiation::Differentiable, U : _Differentiation::Differentiable, V : _Differentiation::Differentiable, R : Swift::FloatingPoint, R : _Differentiation::Differentiable, R == R.TangentVector {
|
|
158
|
+
let (y, pullback) = valueWithPullback(at: x, y, z, of: f)
|
|
159
|
+
return (y, pullback(R(1)))
|
|
160
|
+
}
|
|
161
|
+
@inlinable public func valueWithGradient<T, R, E>(at x: T, of f: @differentiable(reverse) (T) throws(E) -> R) throws(E) -> (value: R, gradient: T.TangentVector) where T : _Differentiation::Differentiable, R : Swift::FloatingPoint, R : _Differentiation::Differentiable, R == R.TangentVector, E : Swift::Error {
|
|
162
|
+
let (y, pullback) = try valueWithPullback(at: x, of: f)
|
|
163
|
+
return (y, pullback(R(1)))
|
|
164
|
+
}
|
|
165
|
+
@inlinable public func valueWithGradient<T, U, R, E>(at x: T, _ y: U, of f: @differentiable(reverse) (T, U) throws(E) -> R) throws(E) -> (value: R, gradient: (T.TangentVector, U.TangentVector)) where T : _Differentiation::Differentiable, U : _Differentiation::Differentiable, R : Swift::FloatingPoint, R : _Differentiation::Differentiable, R == R.TangentVector, E : Swift::Error {
|
|
166
|
+
let (y, pullback) = try valueWithPullback(at: x, y, of: f)
|
|
167
|
+
return (y, pullback(R(1)))
|
|
168
|
+
}
|
|
169
|
+
@inlinable public func valueWithGradient<T, U, V, R, E>(at x: T, _ y: U, _ z: V, of f: @differentiable(reverse) (T, U, V) throws(E) -> R) throws(E) -> (value: R, gradient: (T.TangentVector, U.TangentVector, V.TangentVector)) where T : _Differentiation::Differentiable, U : _Differentiation::Differentiable, V : _Differentiation::Differentiable, R : Swift::FloatingPoint, R : _Differentiation::Differentiable, R == R.TangentVector, E : Swift::Error {
|
|
170
|
+
let (y, pullback) = try valueWithPullback(at: x, y, z, of: f)
|
|
171
|
+
return (y, pullback(R(1)))
|
|
172
|
+
}
|
|
173
|
+
@inlinable public func derivative<T, R>(of f: @escaping @differentiable(reverse) (T) -> R) -> (T) -> R.TangentVector where T : Swift::FloatingPoint, T : _Differentiation::Differentiable, T == T.TangentVector, R : _Differentiation::Differentiable {
|
|
174
|
+
return { x in derivative(at: x, of: f) }
|
|
175
|
+
}
|
|
176
|
+
@inlinable public func derivative<T, U, R>(of f: @escaping @differentiable(reverse) (T, U) -> R) -> (T, U) -> R.TangentVector where T : Swift::FloatingPoint, T : _Differentiation::Differentiable, T == T.TangentVector, U : Swift::FloatingPoint, U : _Differentiation::Differentiable, U == U.TangentVector, R : _Differentiation::Differentiable {
|
|
177
|
+
return { (x, y) in derivative(at: x, y, of: f) }
|
|
178
|
+
}
|
|
179
|
+
@inlinable public func derivative<T, U, V, R>(of f: @escaping @differentiable(reverse) (T, U, V) -> R) -> (T, U, V) -> R.TangentVector where T : Swift::FloatingPoint, T : _Differentiation::Differentiable, T == T.TangentVector, U : Swift::FloatingPoint, U : _Differentiation::Differentiable, U == U.TangentVector, V : Swift::FloatingPoint, V : _Differentiation::Differentiable, V == V.TangentVector, R : _Differentiation::Differentiable {
|
|
180
|
+
return { (x, y, z) in derivative(at: x, y, z, of: f) }
|
|
181
|
+
}
|
|
182
|
+
@inlinable public func derivative<T, R, E>(of f: @escaping @differentiable(reverse) (T) throws(E) -> R) -> (T) throws(E) -> R.TangentVector where T : Swift::FloatingPoint, T : _Differentiation::Differentiable, T == T.TangentVector, R : _Differentiation::Differentiable, E : Swift::Error {
|
|
183
|
+
return { x in try derivative(at: x, of: f) }
|
|
184
|
+
}
|
|
185
|
+
@inlinable public func derivative<T, U, R, E>(of f: @escaping @differentiable(reverse) (T, U) throws(E) -> R) -> (T, U) throws(E) -> R.TangentVector where T : Swift::FloatingPoint, T : _Differentiation::Differentiable, T == T.TangentVector, U : Swift::FloatingPoint, U : _Differentiation::Differentiable, U == U.TangentVector, R : _Differentiation::Differentiable, E : Swift::Error {
|
|
186
|
+
return { (x, y) in try derivative(at: x, y, of: f) }
|
|
187
|
+
}
|
|
188
|
+
@inlinable public func derivative<T, U, V, R, E>(of f: @escaping @differentiable(reverse) (T, U, V) throws(E) -> R) -> (T, U, V) throws(E) -> R.TangentVector where T : Swift::FloatingPoint, T : _Differentiation::Differentiable, T == T.TangentVector, U : Swift::FloatingPoint, U : _Differentiation::Differentiable, U == U.TangentVector, V : Swift::FloatingPoint, V : _Differentiation::Differentiable, V == V.TangentVector, R : _Differentiation::Differentiable, E : Swift::Error {
|
|
189
|
+
return { (x, y, z) in try derivative(at: x, y, z, of: f) }
|
|
190
|
+
}
|
|
191
|
+
@inlinable public func gradient<T, R>(of f: @escaping @differentiable(reverse) (T) -> R) -> (T) -> T.TangentVector where T : _Differentiation::Differentiable, R : Swift::FloatingPoint, R : _Differentiation::Differentiable, R == R.TangentVector {
|
|
192
|
+
return { x in gradient(at: x, of: f) }
|
|
193
|
+
}
|
|
194
|
+
@inlinable public func gradient<T, U, R>(of f: @escaping @differentiable(reverse) (T, U) -> R) -> (T, U) -> (T.TangentVector, U.TangentVector) where T : _Differentiation::Differentiable, U : _Differentiation::Differentiable, R : Swift::FloatingPoint, R : _Differentiation::Differentiable, R == R.TangentVector {
|
|
195
|
+
return { x, y in gradient(at: x, y, of: f) }
|
|
196
|
+
}
|
|
197
|
+
@inlinable public func gradient<T, U, V, R>(of f: @escaping @differentiable(reverse) (T, U, V) -> R) -> (T, U, V) -> (T.TangentVector, U.TangentVector, V.TangentVector) where T : _Differentiation::Differentiable, U : _Differentiation::Differentiable, V : _Differentiation::Differentiable, R : Swift::FloatingPoint, R : _Differentiation::Differentiable, R == R.TangentVector {
|
|
198
|
+
return { x, y, z in gradient(at: x, y, z, of: f) }
|
|
199
|
+
}
|
|
200
|
+
@inlinable public func gradient<T, R, E>(of f: @escaping @differentiable(reverse) (T) throws(E) -> R) -> (T) throws(E) -> T.TangentVector where T : _Differentiation::Differentiable, R : Swift::FloatingPoint, R : _Differentiation::Differentiable, R == R.TangentVector, E : Swift::Error {
|
|
201
|
+
return { x in try gradient(at: x, of: f) }
|
|
202
|
+
}
|
|
203
|
+
@inlinable public func gradient<T, U, R, E>(of f: @escaping @differentiable(reverse) (T, U) throws(E) -> R) -> (T, U) throws(E) -> (T.TangentVector, U.TangentVector) where T : _Differentiation::Differentiable, U : _Differentiation::Differentiable, R : Swift::FloatingPoint, R : _Differentiation::Differentiable, R == R.TangentVector, E : Swift::Error {
|
|
204
|
+
return { x, y in try gradient(at: x, y, of: f) }
|
|
205
|
+
}
|
|
206
|
+
@inlinable public func gradient<T, U, V, R, E>(of f: @escaping @differentiable(reverse) (T, U, V) throws(E) -> R) -> (T, U, V) throws(E) -> (T.TangentVector, U.TangentVector, V.TangentVector) where T : _Differentiation::Differentiable, U : _Differentiation::Differentiable, V : _Differentiation::Differentiable, R : Swift::FloatingPoint, R : _Differentiation::Differentiable, R == R.TangentVector, E : Swift::Error {
|
|
207
|
+
return { x, y, z in try gradient(at: x, y, z, of: f) }
|
|
208
|
+
}
|
|
209
|
+
@inlinable @inline(__always) @_semantics("autodiff.nonvarying") public func withoutDerivative<T>(at x: T) -> T {
|
|
210
|
+
x
|
|
211
|
+
}
|
|
212
|
+
@_silgen_name("_fatalErrorForwardModeDifferentiationDisabled")
|
|
213
|
+
public func _fatalErrorForwardModeDifferentiationDisabled() -> Swift::Never
|
|
214
|
+
public struct AnyDifferentiable : _Differentiation::Differentiable {
|
|
215
|
+
public var base: Any {
|
|
216
|
+
get
|
|
217
|
+
}
|
|
218
|
+
@differentiable(reverse, wrt: base)
|
|
219
|
+
public init<T>(_ base: T) where T : _Differentiation::Differentiable
|
|
220
|
+
@derivative(of: init, wrt: base)
|
|
221
|
+
@inlinable internal static func _vjpInit<T>(_ base: T) -> (value: _Differentiation::AnyDifferentiable, pullback: (_Differentiation::AnyDerivative) -> T.TangentVector) where T : _Differentiation::Differentiable {
|
|
222
|
+
return (AnyDifferentiable(base), { v in v.base as! T.TangentVector })
|
|
223
|
+
}
|
|
224
|
+
@derivative(of: init, wrt: base)
|
|
225
|
+
@inlinable internal static func _jvpInit<T>(_ base: T) -> (value: _Differentiation::AnyDifferentiable, differential: (T.TangentVector) -> _Differentiation::AnyDerivative) where T : _Differentiation::Differentiable {
|
|
226
|
+
return (AnyDifferentiable(base), { dbase in AnyDerivative(dbase) })
|
|
227
|
+
}
|
|
228
|
+
public typealias TangentVector = _Differentiation::AnyDerivative
|
|
229
|
+
public mutating func move(by offset: _Differentiation::AnyDifferentiable._Differentiation::TangentVector)
|
|
230
|
+
}
|
|
231
|
+
extension _Differentiation::AnyDifferentiable : Swift::CustomReflectable {
|
|
232
|
+
public var customMirror: Swift::Mirror {
|
|
233
|
+
get
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
@usableFromInline
|
|
237
|
+
internal protocol _AnyDerivativeBox {
|
|
238
|
+
func _isEqual(to other: any _Differentiation::_AnyDerivativeBox) -> Swift::Bool
|
|
239
|
+
func _isNotEqual(to other: any _Differentiation::_AnyDerivativeBox) -> Swift::Bool
|
|
240
|
+
static var _zero: any _Differentiation::_AnyDerivativeBox { get }
|
|
241
|
+
func _adding(_ x: any _Differentiation::_AnyDerivativeBox) -> any _Differentiation::_AnyDerivativeBox
|
|
242
|
+
func _subtracting(_ x: any _Differentiation::_AnyDerivativeBox) -> any _Differentiation::_AnyDerivativeBox
|
|
243
|
+
mutating func _move(by offset: any _Differentiation::_AnyDerivativeBox)
|
|
244
|
+
var _typeErasedBase: Any { get }
|
|
245
|
+
func _unboxed<U>(to type: U.Type) -> U? where U : _Differentiation::Differentiable, U == U.TangentVector
|
|
246
|
+
}
|
|
247
|
+
extension _Differentiation::_AnyDerivativeBox {
|
|
248
|
+
@inlinable internal func _isOpaqueZero() -> Swift::Bool {
|
|
249
|
+
return _unboxed(to: AnyDerivative.OpaqueZero.self) != nil
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
@usableFromInline
|
|
253
|
+
@frozen internal struct _ConcreteDerivativeBox<T> : _Differentiation::_AnyDerivativeBox where T : _Differentiation::Differentiable, T == T.TangentVector {
|
|
254
|
+
@usableFromInline
|
|
255
|
+
internal var _base: T
|
|
256
|
+
@inlinable internal init(_ base: T) {
|
|
257
|
+
self._base = base
|
|
258
|
+
}
|
|
259
|
+
@inlinable internal var _typeErasedBase: Any {
|
|
260
|
+
get {
|
|
261
|
+
return _base
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
@inlinable internal func _unboxed<U>(to type: U.Type) -> U? where U : _Differentiation::Differentiable, U == U.TangentVector {
|
|
265
|
+
return (self as? _ConcreteDerivativeBox<U>)?._base
|
|
266
|
+
}
|
|
267
|
+
@inlinable internal func _isEqual(to other: any _Differentiation::_AnyDerivativeBox) -> Swift::Bool {
|
|
268
|
+
return _base == other._unboxed(to: T.self)
|
|
269
|
+
}
|
|
270
|
+
@inlinable internal func _isNotEqual(to other: any _Differentiation::_AnyDerivativeBox) -> Swift::Bool {
|
|
271
|
+
return _base != other._unboxed(to: T.self)
|
|
272
|
+
}
|
|
273
|
+
@inlinable internal static var _zero: any _Differentiation::_AnyDerivativeBox {
|
|
274
|
+
get {
|
|
275
|
+
return _ConcreteDerivativeBox(T.zero)
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
@inlinable internal func _adding(_ x: any _Differentiation::_AnyDerivativeBox) -> any _Differentiation::_AnyDerivativeBox {
|
|
279
|
+
|
|
280
|
+
if _isOpaqueZero() {
|
|
281
|
+
return x
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
if x._isOpaqueZero() {
|
|
285
|
+
return self
|
|
286
|
+
}
|
|
287
|
+
guard let xBase = x._unboxed(to: T.self) else {
|
|
288
|
+
_derivativeTypeMismatch(T.self, type(of: x._typeErasedBase))
|
|
289
|
+
}
|
|
290
|
+
return _ConcreteDerivativeBox(_base + xBase)
|
|
291
|
+
}
|
|
292
|
+
@inlinable internal func _subtracting(_ x: any _Differentiation::_AnyDerivativeBox) -> any _Differentiation::_AnyDerivativeBox {
|
|
293
|
+
|
|
294
|
+
if x._isOpaqueZero() {
|
|
295
|
+
return self
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
if _isOpaqueZero() {
|
|
299
|
+
return type(of: x)._zero._subtracting(x)
|
|
300
|
+
}
|
|
301
|
+
guard let xBase = x._unboxed(to: T.self) else {
|
|
302
|
+
_derivativeTypeMismatch(T.self, type(of: x._typeErasedBase))
|
|
303
|
+
}
|
|
304
|
+
return _ConcreteDerivativeBox(_base - xBase)
|
|
305
|
+
}
|
|
306
|
+
@inlinable internal mutating func _move(by offset: any _Differentiation::_AnyDerivativeBox) {
|
|
307
|
+
if offset._isOpaqueZero() {
|
|
308
|
+
return
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
guard let offsetBase = offset._unboxed(to: T.TangentVector.self) else {
|
|
313
|
+
_derivativeTypeMismatch(T.self, type(of: offset._typeErasedBase))
|
|
314
|
+
}
|
|
315
|
+
_base.move(by: offsetBase)
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
@frozen public struct AnyDerivative : Swift::AdditiveArithmetic & _Differentiation::Differentiable {
|
|
319
|
+
@usableFromInline
|
|
320
|
+
internal var _box: any _Differentiation::_AnyDerivativeBox
|
|
321
|
+
@inlinable internal init(_box: any _Differentiation::_AnyDerivativeBox) {
|
|
322
|
+
self._box = _box
|
|
323
|
+
}
|
|
324
|
+
@inlinable public var base: Any {
|
|
325
|
+
get {
|
|
326
|
+
return _box._typeErasedBase
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
@differentiable(reverse, wrt: base)
|
|
330
|
+
@inlinable public init<T>(_ base: T) where T : _Differentiation::Differentiable, T == T.TangentVector {
|
|
331
|
+
self._box = _ConcreteDerivativeBox<T>(base)
|
|
332
|
+
}
|
|
333
|
+
@derivative(of: init, wrt: base)
|
|
334
|
+
@inlinable internal static func _vjpInit<T>(_ base: T) -> (value: _Differentiation::AnyDerivative, pullback: (_Differentiation::AnyDerivative) -> T.TangentVector) where T : _Differentiation::Differentiable, T == T.TangentVector {
|
|
335
|
+
return (AnyDerivative(base), { v in v.base as! T.TangentVector })
|
|
336
|
+
}
|
|
337
|
+
@derivative(of: init, wrt: base)
|
|
338
|
+
@inlinable internal static func _jvpInit<T>(_ base: T) -> (value: _Differentiation::AnyDerivative, differential: (T.TangentVector) -> _Differentiation::AnyDerivative) where T : _Differentiation::Differentiable, T == T.TangentVector {
|
|
339
|
+
return (AnyDerivative(base), { dbase in AnyDerivative(dbase) })
|
|
340
|
+
}
|
|
341
|
+
public typealias TangentVector = _Differentiation::AnyDerivative
|
|
342
|
+
@inlinable public static func == (lhs: _Differentiation::AnyDerivative, rhs: _Differentiation::AnyDerivative) -> Swift::Bool {
|
|
343
|
+
return lhs._box._isEqual(to: rhs._box)
|
|
344
|
+
}
|
|
345
|
+
@inlinable public static func != (lhs: _Differentiation::AnyDerivative, rhs: _Differentiation::AnyDerivative) -> Swift::Bool {
|
|
346
|
+
return lhs._box._isNotEqual(to: rhs._box)
|
|
347
|
+
}
|
|
348
|
+
@usableFromInline
|
|
349
|
+
@frozen internal struct OpaqueZero : Swift::AdditiveArithmetic & _Differentiation::Differentiable {
|
|
350
|
+
@usableFromInline
|
|
351
|
+
internal static func + (lhs: _Differentiation::AnyDerivative._Differentiation::OpaqueZero, rhs: _Differentiation::AnyDerivative._Differentiation::OpaqueZero) -> _Differentiation::AnyDerivative._Differentiation::OpaqueZero
|
|
352
|
+
@usableFromInline
|
|
353
|
+
internal static func - (lhs: _Differentiation::AnyDerivative._Differentiation::OpaqueZero, rhs: _Differentiation::AnyDerivative._Differentiation::OpaqueZero) -> _Differentiation::AnyDerivative._Differentiation::OpaqueZero
|
|
354
|
+
@usableFromInline
|
|
355
|
+
internal static func == (a: _Differentiation::AnyDerivative._Differentiation::OpaqueZero, b: _Differentiation::AnyDerivative._Differentiation::OpaqueZero) -> Swift::Bool
|
|
356
|
+
@usableFromInline
|
|
357
|
+
internal typealias TangentVector = _Differentiation::AnyDerivative._Differentiation::OpaqueZero
|
|
358
|
+
@usableFromInline
|
|
359
|
+
internal static var zero: _Differentiation::AnyDerivative._Differentiation::OpaqueZero {
|
|
360
|
+
@usableFromInline
|
|
361
|
+
get
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
@inlinable public static var zero: _Differentiation::AnyDerivative {
|
|
365
|
+
get {
|
|
366
|
+
return AnyDerivative(
|
|
367
|
+
_box: _ConcreteDerivativeBox<OpaqueZero>(OpaqueZero.zero))
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
@inlinable public static func + (lhs: _Differentiation::AnyDerivative, rhs: _Differentiation::AnyDerivative) -> _Differentiation::AnyDerivative {
|
|
371
|
+
return AnyDerivative(_box: lhs._box._adding(rhs._box))
|
|
372
|
+
}
|
|
373
|
+
@derivative(of: +, wrt: (lhs, rhs))
|
|
374
|
+
@inlinable internal static func _vjpAdd(lhs: _Differentiation::AnyDerivative, rhs: _Differentiation::AnyDerivative) -> (value: _Differentiation::AnyDerivative, pullback: (_Differentiation::AnyDerivative) -> (_Differentiation::AnyDerivative, _Differentiation::AnyDerivative)) {
|
|
375
|
+
return (lhs + rhs, { v in (v, v) })
|
|
376
|
+
}
|
|
377
|
+
@derivative(of: +, wrt: (lhs, rhs))
|
|
378
|
+
@inlinable internal static func _jvpAdd(lhs: _Differentiation::AnyDerivative, rhs: _Differentiation::AnyDerivative) -> (value: _Differentiation::AnyDerivative, differential: (_Differentiation::AnyDerivative, _Differentiation::AnyDerivative) -> _Differentiation::AnyDerivative) {
|
|
379
|
+
return (lhs + rhs, { (dlhs, drhs) in dlhs + drhs })
|
|
380
|
+
}
|
|
381
|
+
@inlinable public static func - (lhs: _Differentiation::AnyDerivative, rhs: _Differentiation::AnyDerivative) -> _Differentiation::AnyDerivative {
|
|
382
|
+
return AnyDerivative(_box: lhs._box._subtracting(rhs._box))
|
|
383
|
+
}
|
|
384
|
+
@derivative(of: -, wrt: (lhs, rhs))
|
|
385
|
+
@inlinable internal static func _vjpSubtract(lhs: _Differentiation::AnyDerivative, rhs: _Differentiation::AnyDerivative) -> (value: _Differentiation::AnyDerivative, pullback: (_Differentiation::AnyDerivative) -> (_Differentiation::AnyDerivative, _Differentiation::AnyDerivative)) {
|
|
386
|
+
return (lhs - rhs, { v in (v, .zero - v) })
|
|
387
|
+
}
|
|
388
|
+
@derivative(of: -, wrt: (lhs, rhs))
|
|
389
|
+
@inlinable internal static func _jvpSubtract(lhs: _Differentiation::AnyDerivative, rhs: _Differentiation::AnyDerivative) -> (value: _Differentiation::AnyDerivative, differential: (_Differentiation::AnyDerivative, _Differentiation::AnyDerivative) -> _Differentiation::AnyDerivative) {
|
|
390
|
+
return (lhs - rhs, { (dlhs, drhs) in dlhs - drhs })
|
|
391
|
+
}
|
|
392
|
+
@inlinable public mutating func move(by offset: _Differentiation::AnyDerivative._Differentiation::TangentVector) {
|
|
393
|
+
if _box._isOpaqueZero() {
|
|
394
|
+
_box = offset._box
|
|
395
|
+
return
|
|
396
|
+
}
|
|
397
|
+
_box._move(by: offset._box)
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
extension _Differentiation::AnyDerivative : Swift::CustomReflectable {
|
|
401
|
+
public var customMirror: Swift::Mirror {
|
|
402
|
+
get
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
@usableFromInline
|
|
406
|
+
@inline(never) internal func _derivativeTypeMismatch(_ x: any Any.Type, _ y: any Any.Type, file: Swift::StaticString = #file, line: Swift::UInt = #line) -> Swift::Never
|
|
407
|
+
extension Swift::Array where Element : _Differentiation::Differentiable {
|
|
408
|
+
@frozen public struct DifferentiableView {
|
|
409
|
+
@usableFromInline
|
|
410
|
+
internal var _base: [Element]
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
extension Swift::Array._Differentiation::DifferentiableView : _Differentiation::Differentiable {
|
|
414
|
+
@inlinable public var base: [Element] {
|
|
415
|
+
get { _base }
|
|
416
|
+
_modify { yield &_base }
|
|
417
|
+
}
|
|
418
|
+
@derivative(of: base, wrt: self)
|
|
419
|
+
@inlinable internal func _vjpBase() -> (value: [Element], pullback: (Swift::Array<Element>._Differentiation::TangentVector) -> Swift::Array<Element>._Differentiation::DifferentiableView._Differentiation::TangentVector) {
|
|
420
|
+
return (base, { $0 })
|
|
421
|
+
}
|
|
422
|
+
@derivative(of: base, wrt: self)
|
|
423
|
+
@inlinable internal func _jvpBase() -> (value: [Element], differential: (Swift::Array<Element>._Differentiation::TangentVector) -> Swift::Array<Element>._Differentiation::DifferentiableView._Differentiation::TangentVector) {
|
|
424
|
+
return (base, { $0 })
|
|
425
|
+
}
|
|
426
|
+
@inlinable public init(_ base: [Element]) { self._base = base }
|
|
427
|
+
@derivative(of: init(_:), wrt: base)
|
|
428
|
+
@inlinable internal static func _vjpInit(_ base: [Element]) -> (value: Swift::Array<Element>._Differentiation::DifferentiableView, pullback: (Swift::Array<Element>._Differentiation::DifferentiableView._Differentiation::TangentVector) -> Swift::Array<Element>._Differentiation::DifferentiableView._Differentiation::TangentVector) {
|
|
429
|
+
return (Array.DifferentiableView(base), { $0 })
|
|
430
|
+
}
|
|
431
|
+
@derivative(of: init(_:), wrt: base)
|
|
432
|
+
@inlinable internal static func _jvpInit(_ base: [Element]) -> (value: Swift::Array<Element>._Differentiation::DifferentiableView, differential: (Swift::Array<Element>._Differentiation::DifferentiableView._Differentiation::TangentVector) -> Swift::Array<Element>._Differentiation::DifferentiableView._Differentiation::TangentVector) {
|
|
433
|
+
return (Array.DifferentiableView(base), { $0 })
|
|
434
|
+
}
|
|
435
|
+
public typealias TangentVector = Swift::Array<Element.TangentVector>._Differentiation::DifferentiableView
|
|
436
|
+
@inlinable public mutating func move(by offset: Swift::Array<Element>._Differentiation::DifferentiableView._Differentiation::TangentVector) {
|
|
437
|
+
if offset.base.isEmpty {
|
|
438
|
+
return
|
|
439
|
+
}
|
|
440
|
+
precondition(
|
|
441
|
+
base.count == offset.base.count, """
|
|
442
|
+
Count mismatch: \(base.count) ('self') and \(offset.base.count) \
|
|
443
|
+
('direction')
|
|
444
|
+
""")
|
|
445
|
+
for i in offset.base.indices {
|
|
446
|
+
base[i].move(by: offset.base[i])
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
extension Swift::Array._Differentiation::DifferentiableView : Swift::Equatable where Element : Swift::Equatable {
|
|
451
|
+
@inlinable public static func == (lhs: Swift::Array<Element>._Differentiation::DifferentiableView, rhs: Swift::Array<Element>._Differentiation::DifferentiableView) -> Swift::Bool {
|
|
452
|
+
return lhs.base == rhs.base
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
extension Swift::Array._Differentiation::DifferentiableView : Swift::ExpressibleByArrayLiteral {
|
|
456
|
+
@inlinable public init(arrayLiteral elements: Element...) {
|
|
457
|
+
self.init(elements)
|
|
458
|
+
}
|
|
459
|
+
public typealias ArrayLiteralElement = Element
|
|
460
|
+
}
|
|
461
|
+
extension Swift::Array._Differentiation::DifferentiableView : Swift::CustomStringConvertible {
|
|
462
|
+
public var description: Swift::String {
|
|
463
|
+
get
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
extension Swift::Array._Differentiation::DifferentiableView : Swift::CustomReflectable {
|
|
467
|
+
public var customMirror: Swift::Mirror {
|
|
468
|
+
get
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
extension Swift::Array._Differentiation::DifferentiableView : Swift::AdditiveArithmetic where Element : Swift::AdditiveArithmetic {
|
|
472
|
+
@inlinable public static var zero: Swift::Array<Element>._Differentiation::DifferentiableView {
|
|
473
|
+
get {
|
|
474
|
+
return Array.DifferentiableView([])
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
@inlinable public static func + (lhs: Swift::Array<Element>._Differentiation::DifferentiableView, rhs: Swift::Array<Element>._Differentiation::DifferentiableView) -> Swift::Array<Element>._Differentiation::DifferentiableView {
|
|
478
|
+
if lhs.base.count == 0 {
|
|
479
|
+
return rhs
|
|
480
|
+
}
|
|
481
|
+
if rhs.base.count == 0 {
|
|
482
|
+
return lhs
|
|
483
|
+
}
|
|
484
|
+
precondition(
|
|
485
|
+
lhs.base.count == rhs.base.count,
|
|
486
|
+
"Count mismatch: \(lhs.base.count) and \(rhs.base.count)")
|
|
487
|
+
return Array.DifferentiableView(zip(lhs.base, rhs.base).map(+))
|
|
488
|
+
}
|
|
489
|
+
@inlinable public static func - (lhs: Swift::Array<Element>._Differentiation::DifferentiableView, rhs: Swift::Array<Element>._Differentiation::DifferentiableView) -> Swift::Array<Element>._Differentiation::DifferentiableView {
|
|
490
|
+
if lhs.base.count == 0 {
|
|
491
|
+
return Array.DifferentiableView(rhs.base.map { .zero - $0 })
|
|
492
|
+
}
|
|
493
|
+
if rhs.base.count == 0 {
|
|
494
|
+
return lhs
|
|
495
|
+
}
|
|
496
|
+
precondition(
|
|
497
|
+
lhs.base.count == rhs.base.count,
|
|
498
|
+
"Count mismatch: \(lhs.base.count) and \(rhs.base.count)")
|
|
499
|
+
return Array.DifferentiableView(zip(lhs.base, rhs.base).map(-))
|
|
500
|
+
}
|
|
501
|
+
@inlinable public subscript(index: Swift::Int) -> Element {
|
|
502
|
+
get {
|
|
503
|
+
if index < base.count {
|
|
504
|
+
return base[index]
|
|
505
|
+
} else {
|
|
506
|
+
return Element.zero
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
extension Swift::Array : _Differentiation::Differentiable where Element : _Differentiation::Differentiable {
|
|
512
|
+
public typealias TangentVector = Swift::Array<Element.TangentVector>._Differentiation::DifferentiableView
|
|
513
|
+
@inlinable public mutating func move(by offset: Swift::Array<Element>._Differentiation::TangentVector) {
|
|
514
|
+
var view = DifferentiableView(self)
|
|
515
|
+
view.move(by: offset)
|
|
516
|
+
self = view.base
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
extension Swift::Array where Element : _Differentiation::Differentiable {
|
|
520
|
+
@derivative(of: subscript, wrt: self)
|
|
521
|
+
@inlinable internal func _vjpSubscript(index: Swift::Int) -> (value: Element, pullback: (Element.TangentVector) -> Swift::Array<Element>._Differentiation::TangentVector) {
|
|
522
|
+
func pullback(_ v: Element.TangentVector) -> TangentVector {
|
|
523
|
+
var dSelf = [Element.TangentVector](
|
|
524
|
+
repeating: .zero,
|
|
525
|
+
count: count)
|
|
526
|
+
dSelf[index] = v
|
|
527
|
+
return TangentVector(dSelf)
|
|
528
|
+
}
|
|
529
|
+
return (self[index], pullback)
|
|
530
|
+
}
|
|
531
|
+
@derivative(of: subscript, wrt: self)
|
|
532
|
+
@inlinable internal func _jvpSubscript(index: Swift::Int) -> (value: Element, differential: (Swift::Array<Element>._Differentiation::TangentVector) -> Element.TangentVector) {
|
|
533
|
+
func differential(_ v: TangentVector) -> Element.TangentVector {
|
|
534
|
+
return v[index]
|
|
535
|
+
}
|
|
536
|
+
return (self[index], differential)
|
|
537
|
+
}
|
|
538
|
+
@derivative(of: +, wrt: (lhs, rhs))
|
|
539
|
+
@inlinable internal static func _vjpConcatenate(_ lhs: Swift::Array<Element>, _ rhs: Swift::Array<Element>) -> (value: Swift::Array<Element>, pullback: (Swift::Array<Element>._Differentiation::TangentVector) -> (Swift::Array<Element>._Differentiation::TangentVector, Swift::Array<Element>._Differentiation::TangentVector)) {
|
|
540
|
+
func pullback(_ v: TangentVector) -> (TangentVector, TangentVector) {
|
|
541
|
+
if v.base.isEmpty {
|
|
542
|
+
return (.zero, .zero)
|
|
543
|
+
}
|
|
544
|
+
precondition(
|
|
545
|
+
v.base.count == lhs.count + rhs.count, """
|
|
546
|
+
Tangent vector with invalid count \(v.base.count); expected to \
|
|
547
|
+
equal the sum of operand counts \(lhs.count) and \(rhs.count)
|
|
548
|
+
""")
|
|
549
|
+
return (
|
|
550
|
+
TangentVector([Element.TangentVector](v.base[0..<lhs.count])),
|
|
551
|
+
TangentVector([Element.TangentVector](v.base[lhs.count...]))
|
|
552
|
+
)
|
|
553
|
+
}
|
|
554
|
+
return (lhs + rhs, pullback)
|
|
555
|
+
}
|
|
556
|
+
@derivative(of: +, wrt: (lhs, rhs))
|
|
557
|
+
@inlinable internal static func _jvpConcatenate(_ lhs: Swift::Array<Element>, _ rhs: Swift::Array<Element>) -> (value: Swift::Array<Element>, differential: (Swift::Array<Element>._Differentiation::TangentVector, Swift::Array<Element>._Differentiation::TangentVector) -> Swift::Array<Element>._Differentiation::TangentVector) {
|
|
558
|
+
func differential(_ l: TangentVector, _ r: TangentVector) -> TangentVector {
|
|
559
|
+
precondition(
|
|
560
|
+
l.base.count == lhs.count && r.base.count == rhs.count, """
|
|
561
|
+
Tangent vectors with invalid count; expected to equal the \
|
|
562
|
+
operand counts \(lhs.count) and \(rhs.count)
|
|
563
|
+
""")
|
|
564
|
+
return .init(l.base + r.base)
|
|
565
|
+
}
|
|
566
|
+
return (lhs + rhs, differential)
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
extension Swift::Array where Element : _Differentiation::Differentiable {
|
|
570
|
+
@derivative(of: append, wrt: (self, element))
|
|
571
|
+
@inlinable internal mutating func _vjpAppend(_ element: Element) -> (value: Swift::Void, pullback: (inout Swift::Array<Element>._Differentiation::TangentVector) -> Element.TangentVector) {
|
|
572
|
+
let appendedElementIndex = count
|
|
573
|
+
append(element)
|
|
574
|
+
return ((), { v in
|
|
575
|
+
defer { v.base.removeLast() }
|
|
576
|
+
return v.base[appendedElementIndex]
|
|
577
|
+
})
|
|
578
|
+
}
|
|
579
|
+
@derivative(of: append, wrt: (self, element))
|
|
580
|
+
@inlinable internal mutating func _jvpAppend(_ element: Element) -> (value: Swift::Void, differential: (inout Swift::Array<Element>._Differentiation::TangentVector, Element.TangentVector) -> Swift::Void) {
|
|
581
|
+
append(element)
|
|
582
|
+
return ((), { $0.base.append($1) })
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
extension Swift::Array where Element : _Differentiation::Differentiable {
|
|
586
|
+
@derivative(of: +=, wrt: (lhs, rhs))
|
|
587
|
+
@inlinable internal static func _vjpAppend(_ lhs: inout Swift::Array<Element>, _ rhs: Swift::Array<Element>) -> (value: Swift::Void, pullback: (inout Swift::Array<Element>._Differentiation::TangentVector) -> Swift::Array<Element>._Differentiation::TangentVector) {
|
|
588
|
+
let lhsCount = lhs.count
|
|
589
|
+
lhs += rhs
|
|
590
|
+
return ((), { v in
|
|
591
|
+
let drhs =
|
|
592
|
+
TangentVector(.init(v.base.dropFirst(lhsCount)))
|
|
593
|
+
let rhsCount = drhs.base.count
|
|
594
|
+
v.base.removeLast(rhsCount)
|
|
595
|
+
return drhs
|
|
596
|
+
})
|
|
597
|
+
}
|
|
598
|
+
@derivative(of: +=, wrt: (lhs, rhs))
|
|
599
|
+
@inlinable internal static func _jvpAppend(_ lhs: inout Swift::Array<Element>, _ rhs: Swift::Array<Element>) -> (value: Swift::Void, differential: (inout Swift::Array<Element>._Differentiation::TangentVector, Swift::Array<Element>._Differentiation::TangentVector) -> Swift::Void) {
|
|
600
|
+
lhs += rhs
|
|
601
|
+
return ((), { $0.base += $1.base })
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
extension Swift::Array where Element : _Differentiation::Differentiable {
|
|
605
|
+
@derivative(of: init(repeating:count:), wrt: repeatedValue)
|
|
606
|
+
@inlinable internal static func _vjpInit(repeating repeatedValue: Element, count: Swift::Int) -> (value: Swift::Array<Element>, pullback: (Swift::Array<Element>._Differentiation::TangentVector) -> Element.TangentVector) {
|
|
607
|
+
(
|
|
608
|
+
value: Self(repeating: repeatedValue, count: count),
|
|
609
|
+
pullback: { v in
|
|
610
|
+
v.base.reduce(.zero, +)
|
|
611
|
+
}
|
|
612
|
+
)
|
|
613
|
+
}
|
|
614
|
+
@derivative(of: init(repeating:count:), wrt: repeatedValue)
|
|
615
|
+
@inlinable internal static func _jvpInit(repeating repeatedValue: Element, count: Swift::Int) -> (value: Swift::Array<Element>, differential: (Element.TangentVector) -> Swift::Array<Element>._Differentiation::TangentVector) {
|
|
616
|
+
(
|
|
617
|
+
value: Self(repeating: repeatedValue, count: count),
|
|
618
|
+
differential: { v in TangentVector(.init(repeating: v, count: count)) }
|
|
619
|
+
)
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
extension Swift::Array where Element : _Differentiation::Differentiable {
|
|
623
|
+
@differentiable(reverse, wrt: self)
|
|
624
|
+
@inlinable public func differentiableMap<Result>(_ body: @differentiable(reverse) (Element) -> Result) -> [Result] where Result : _Differentiation::Differentiable {
|
|
625
|
+
map(body)
|
|
626
|
+
}
|
|
627
|
+
@derivative(of: differentiableMap, wrt: self)
|
|
628
|
+
@inlinable internal func _vjpDifferentiableMap<Result>(_ body: @differentiable(reverse) (Element) -> Result) -> (value: [Result], pullback: (Swift::Array<Result>._Differentiation::TangentVector) -> Swift::Array<Element>._Differentiation::TangentVector) where Result : _Differentiation::Differentiable {
|
|
629
|
+
let count = self.count
|
|
630
|
+
var values: [Result] = []
|
|
631
|
+
var pullbacks: [(Result.TangentVector) -> Element.TangentVector] = []
|
|
632
|
+
values.reserveCapacity(count)
|
|
633
|
+
pullbacks.reserveCapacity(count)
|
|
634
|
+
for x in self {
|
|
635
|
+
let (y, pb) = valueWithPullback(at: x, of: body)
|
|
636
|
+
values.append(y)
|
|
637
|
+
pullbacks.append(pb)
|
|
638
|
+
}
|
|
639
|
+
func pullback(_ tans: Array<Result>.TangentVector) -> Array.TangentVector {
|
|
640
|
+
.init(zip(tans.base, pullbacks).map { tan, pb in pb(tan) })
|
|
641
|
+
}
|
|
642
|
+
return (value: values, pullback: pullback)
|
|
643
|
+
}
|
|
644
|
+
@derivative(of: differentiableMap, wrt: self)
|
|
645
|
+
@inlinable internal func _jvpDifferentiableMap<Result>(_ body: @differentiable(reverse) (Element) -> Result) -> (value: [Result], differential: (Swift::Array<Element>._Differentiation::TangentVector) -> Swift::Array<Result>._Differentiation::TangentVector) where Result : _Differentiation::Differentiable {
|
|
646
|
+
var values: [Result] = []
|
|
647
|
+
var differentials: [(Element.TangentVector) -> Result.TangentVector] = []
|
|
648
|
+
for x in self {
|
|
649
|
+
let (y, df) = valueWithDifferential(at: x, of: body)
|
|
650
|
+
values.append(y)
|
|
651
|
+
differentials.append(df)
|
|
652
|
+
}
|
|
653
|
+
func differential(_ tans: Array.TangentVector) -> Array<Result>.TangentVector {
|
|
654
|
+
.init(zip(tans.base, differentials).map { tan, df in df(tan) })
|
|
655
|
+
}
|
|
656
|
+
return (value: values, differential: differential)
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
extension Swift::Array where Element : _Differentiation::Differentiable {
|
|
660
|
+
@differentiable(reverse, wrt: (self, initialResult))
|
|
661
|
+
@inlinable public func differentiableReduce<Result>(_ initialResult: Result, _ nextPartialResult: @differentiable(reverse) (Result, Element) -> Result) -> Result where Result : _Differentiation::Differentiable {
|
|
662
|
+
reduce(initialResult, nextPartialResult)
|
|
663
|
+
}
|
|
664
|
+
@derivative(of: differentiableReduce, wrt: (self, initialResult))
|
|
665
|
+
@inlinable internal func _vjpDifferentiableReduce<Result>(_ initialResult: Result, _ nextPartialResult: @differentiable(reverse) (Result, Element) -> Result) -> (value: Result, pullback: (Result.TangentVector) -> (Swift::Array<Element>._Differentiation::TangentVector, Result.TangentVector)) where Result : _Differentiation::Differentiable {
|
|
666
|
+
var pullbacks:
|
|
667
|
+
[(Result.TangentVector) -> (Result.TangentVector, Element.TangentVector)] =
|
|
668
|
+
[]
|
|
669
|
+
let count = self.count
|
|
670
|
+
pullbacks.reserveCapacity(count)
|
|
671
|
+
var result = initialResult
|
|
672
|
+
for element in self {
|
|
673
|
+
let (y, pb) =
|
|
674
|
+
valueWithPullback(at: result, element, of: nextPartialResult)
|
|
675
|
+
result = y
|
|
676
|
+
pullbacks.append(pb)
|
|
677
|
+
}
|
|
678
|
+
return (
|
|
679
|
+
value: result,
|
|
680
|
+
pullback: { tangent in
|
|
681
|
+
var resultTangent = tangent
|
|
682
|
+
var elementTangents = TangentVector([])
|
|
683
|
+
elementTangents.base.reserveCapacity(count)
|
|
684
|
+
for pullback in pullbacks.reversed() {
|
|
685
|
+
let (newResultTangent, elementTangent) = pullback(resultTangent)
|
|
686
|
+
resultTangent = newResultTangent
|
|
687
|
+
elementTangents.base.append(elementTangent)
|
|
688
|
+
}
|
|
689
|
+
return (TangentVector(elementTangents.base.reversed()), resultTangent)
|
|
690
|
+
}
|
|
691
|
+
)
|
|
692
|
+
}
|
|
693
|
+
@derivative(of: differentiableReduce, wrt: (self, initialResult))
|
|
694
|
+
@inlinable internal func _jvpDifferentiableReduce<Result>(_ initialResult: Result, _ nextPartialResult: @differentiable(reverse) (Result, Element) -> Result) -> (value: Result, differential: (Swift::Array<Element>._Differentiation::TangentVector, Result.TangentVector) -> Result.TangentVector) where Result : _Differentiation::Differentiable {
|
|
695
|
+
var differentials:
|
|
696
|
+
[(Result.TangentVector, Element.TangentVector) -> Result.TangentVector]
|
|
697
|
+
= []
|
|
698
|
+
let count = self.count
|
|
699
|
+
differentials.reserveCapacity(count)
|
|
700
|
+
var result = initialResult
|
|
701
|
+
for element in self {
|
|
702
|
+
let (y, df) =
|
|
703
|
+
valueWithDifferential(at: result, element, of: nextPartialResult)
|
|
704
|
+
result = y
|
|
705
|
+
differentials.append(df)
|
|
706
|
+
}
|
|
707
|
+
return (value: result, differential: { dSelf, dInitial in
|
|
708
|
+
var dResult = dInitial
|
|
709
|
+
for (dElement, df) in zip(dSelf.base, differentials) {
|
|
710
|
+
dResult = df(dResult, dElement)
|
|
711
|
+
}
|
|
712
|
+
return dResult
|
|
713
|
+
})
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
extension Swift::Optional : _Differentiation::Differentiable where Wrapped : _Differentiation::Differentiable {
|
|
717
|
+
@frozen public struct TangentVector : _Differentiation::Differentiable, Swift::AdditiveArithmetic {
|
|
718
|
+
public typealias TangentVector = Swift::Optional<Wrapped>._Differentiation::TangentVector
|
|
719
|
+
public var value: Wrapped.TangentVector?
|
|
720
|
+
@inlinable public init(_ value: Wrapped.TangentVector?) {
|
|
721
|
+
self.value = value
|
|
722
|
+
}
|
|
723
|
+
@inlinable public static var zero: Swift::Optional<Wrapped>._Differentiation::TangentVector {
|
|
724
|
+
get {
|
|
725
|
+
return Self(.zero)
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
@inlinable public static func + (lhs: Swift::Optional<Wrapped>._Differentiation::TangentVector, rhs: Swift::Optional<Wrapped>._Differentiation::TangentVector) -> Swift::Optional<Wrapped>._Differentiation::TangentVector {
|
|
729
|
+
switch (lhs.value, rhs.value) {
|
|
730
|
+
case (nil, nil): return Self(nil)
|
|
731
|
+
case let (x?, nil): return Self(x)
|
|
732
|
+
case let (nil, y?): return Self(y)
|
|
733
|
+
case let (x?, y?): return Self(x + y)
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
@inlinable public static func - (lhs: Swift::Optional<Wrapped>._Differentiation::TangentVector, rhs: Swift::Optional<Wrapped>._Differentiation::TangentVector) -> Swift::Optional<Wrapped>._Differentiation::TangentVector {
|
|
737
|
+
switch (lhs.value, rhs.value) {
|
|
738
|
+
case (nil, nil): return Self(nil)
|
|
739
|
+
case let (x?, nil): return Self(x)
|
|
740
|
+
case let (nil, y?): return Self(.zero - y)
|
|
741
|
+
case let (x?, y?): return Self(x - y)
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
@inlinable public mutating func move(by offset: Swift::Optional<Wrapped>._Differentiation::TangentVector._Differentiation::TangentVector) {
|
|
745
|
+
if let value = offset.value {
|
|
746
|
+
self.value?.move(by: value)
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
public static func == (a: Swift::Optional<Wrapped>._Differentiation::TangentVector, b: Swift::Optional<Wrapped>._Differentiation::TangentVector) -> Swift::Bool
|
|
750
|
+
}
|
|
751
|
+
@inlinable public mutating func move(by offset: Swift::Optional<Wrapped>._Differentiation::TangentVector) {
|
|
752
|
+
if let value = offset.value {
|
|
753
|
+
self?.move(by: value)
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
extension Swift::Optional._Differentiation::TangentVector : Swift::CustomReflectable {
|
|
758
|
+
public var customMirror: Swift::Mirror {
|
|
759
|
+
get
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
@derivative(of: ??, wrt: optional)
|
|
763
|
+
@_transparent @_alwaysEmitIntoClient internal func _vjpNilCoalescing<T>(optional: T?, defaultValue: @autoclosure () throws -> T) rethrows -> (value: T, pullback: (T.TangentVector) -> Swift::Optional<T>._Differentiation::TangentVector) where T : _Differentiation::Differentiable {
|
|
764
|
+
let hasValue = optional != nil
|
|
765
|
+
let value = try optional ?? defaultValue()
|
|
766
|
+
func pullback(_ v: T.TangentVector) -> Optional<T>.TangentVector {
|
|
767
|
+
return hasValue ? .init(v) : .zero
|
|
768
|
+
}
|
|
769
|
+
return (value, pullback)
|
|
770
|
+
}
|
|
771
|
+
@available(iOS 14.0, tvOS 14.0, watchOS 7.0, *)
|
|
772
|
+
extension Swift::Float16 : _Differentiation::Differentiable {
|
|
773
|
+
@available(iOS 14.0, tvOS 14.0, watchOS 7.0, *)
|
|
774
|
+
public typealias TangentVector = Swift::Float16
|
|
775
|
+
@available(iOS 14.0, tvOS 14.0, watchOS 7.0, *)
|
|
776
|
+
@inlinable public mutating func move(by offset: Swift::Float16._Differentiation::TangentVector) {
|
|
777
|
+
self += offset
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
@available(iOS 14.0, tvOS 14.0, watchOS 7.0, *)
|
|
781
|
+
extension Swift::Float16 {
|
|
782
|
+
@available(iOS 14.0, tvOS 14.0, watchOS 7.0, *)
|
|
783
|
+
@derivative(of: init(_:), wrt: x)
|
|
784
|
+
@inlinable @_transparent internal static func _vjpInit(x: Swift::Float16) -> (value: Swift::Float16, pullback: (Swift::Float16) -> Swift::Float16) {
|
|
785
|
+
return (value: Float16(x), pullback: { v in Float16(v) })
|
|
786
|
+
}
|
|
787
|
+
@available(iOS 14.0, tvOS 14.0, watchOS 7.0, *)
|
|
788
|
+
@derivative(of: init(_:), wrt: x)
|
|
789
|
+
@inlinable @_transparent internal static func _jvpInit(x: Swift::Float16) -> (value: Swift::Float16, differential: (Swift::Float16) -> Swift::Float16) {
|
|
790
|
+
return (value: Float16(x), differential: { dx in Float16(dx) })
|
|
791
|
+
}
|
|
792
|
+
@derivative(of: init(_:), wrt: x)
|
|
793
|
+
@inlinable @_transparent internal static func _vjpInit(x: Swift::Float) -> (value: Swift::Float16, pullback: (Swift::Float16) -> Swift::Float) {
|
|
794
|
+
return (value: Float16(x), pullback: { v in Float(v) })
|
|
795
|
+
}
|
|
796
|
+
@derivative(of: init(_:), wrt: x)
|
|
797
|
+
@inlinable @_transparent internal static func _jvpInit(x: Swift::Float) -> (value: Swift::Float16, differential: (Swift::Float) -> Swift::Float16) {
|
|
798
|
+
return (value: Float16(x), differential: { dx in Float16(dx) })
|
|
799
|
+
}
|
|
800
|
+
@derivative(of: init(_:), wrt: x)
|
|
801
|
+
@inlinable @_transparent internal static func _vjpInit(x: Swift::Double) -> (value: Swift::Float16, pullback: (Swift::Float16) -> Swift::Double) {
|
|
802
|
+
return (value: Float16(x), pullback: { v in Double(v) })
|
|
803
|
+
}
|
|
804
|
+
@derivative(of: init(_:), wrt: x)
|
|
805
|
+
@inlinable @_transparent internal static func _jvpInit(x: Swift::Double) -> (value: Swift::Float16, differential: (Swift::Double) -> Swift::Float16) {
|
|
806
|
+
return (value: Float16(x), differential: { dx in Float16(dx) })
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
@available(iOS 14.0, tvOS 14.0, watchOS 7.0, *)
|
|
810
|
+
extension Swift::Float16 {
|
|
811
|
+
@derivative(of: -, wrt: x)
|
|
812
|
+
@inlinable @_transparent internal static func _vjpNegate(x: Swift::Float16) -> (value: Swift::Float16, pullback: (Swift::Float16) -> Swift::Float16) {
|
|
813
|
+
return (-x, { v in -v })
|
|
814
|
+
}
|
|
815
|
+
@derivative(of: -, wrt: x)
|
|
816
|
+
@inlinable @_transparent internal static func _jvpNegate(x: Swift::Float16) -> (value: Swift::Float16, differential: (Swift::Float16) -> Swift::Float16) {
|
|
817
|
+
return (-x, { dx in -dx })
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
@available(iOS 14.0, tvOS 14.0, watchOS 7.0, *)
|
|
821
|
+
extension Swift::Float16 {
|
|
822
|
+
@available(iOS 14.0, tvOS 14.0, watchOS 7.0, *)
|
|
823
|
+
@derivative(of: +, wrt: (lhs, rhs))
|
|
824
|
+
@inlinable @_transparent internal static func _vjpAdd(lhs: Swift::Float16, rhs: Swift::Float16) -> (value: Swift::Float16, pullback: (Swift::Float16) -> (Swift::Float16, Swift::Float16)) {
|
|
825
|
+
return (lhs + rhs, { v in (v, v) })
|
|
826
|
+
}
|
|
827
|
+
@available(iOS 14.0, tvOS 14.0, watchOS 7.0, *)
|
|
828
|
+
@derivative(of: +, wrt: (lhs, rhs))
|
|
829
|
+
@inlinable @_transparent internal static func _jvpAdd(lhs: Swift::Float16, rhs: Swift::Float16) -> (value: Swift::Float16, differential: (Swift::Float16, Swift::Float16) -> Swift::Float16) {
|
|
830
|
+
return (lhs + rhs, { (dlhs, drhs) in dlhs + drhs })
|
|
831
|
+
}
|
|
832
|
+
@available(iOS 14.0, tvOS 14.0, watchOS 7.0, *)
|
|
833
|
+
@derivative(of: +=, wrt: (lhs, rhs))
|
|
834
|
+
@inlinable @_transparent internal static func _vjpAddAssign(_ lhs: inout Swift::Float16, _ rhs: Swift::Float16) -> (value: Swift::Void, pullback: (inout Swift::Float16) -> Swift::Float16) {
|
|
835
|
+
lhs += rhs
|
|
836
|
+
return ((), { v in v })
|
|
837
|
+
}
|
|
838
|
+
@available(iOS 14.0, tvOS 14.0, watchOS 7.0, *)
|
|
839
|
+
@derivative(of: +=, wrt: (lhs, rhs))
|
|
840
|
+
@inlinable @_transparent internal static func _jvpAddAssign(_ lhs: inout Swift::Float16, _ rhs: Swift::Float16) -> (value: Swift::Void, differential: (inout Swift::Float16, Swift::Float16) -> Swift::Void) {
|
|
841
|
+
lhs += rhs
|
|
842
|
+
return ((), { $0 += $1 })
|
|
843
|
+
}
|
|
844
|
+
@available(iOS 14.0, tvOS 14.0, watchOS 7.0, *)
|
|
845
|
+
@derivative(of: -, wrt: (lhs, rhs))
|
|
846
|
+
@inlinable @_transparent internal static func _vjpSubtract(lhs: Swift::Float16, rhs: Swift::Float16) -> (value: Swift::Float16, pullback: (Swift::Float16) -> (Swift::Float16, Swift::Float16)) {
|
|
847
|
+
return (lhs - rhs, { v in (v, -v) })
|
|
848
|
+
}
|
|
849
|
+
@available(iOS 14.0, tvOS 14.0, watchOS 7.0, *)
|
|
850
|
+
@derivative(of: -, wrt: (lhs, rhs))
|
|
851
|
+
@inlinable @_transparent internal static func _jvpSubtract(lhs: Swift::Float16, rhs: Swift::Float16) -> (value: Swift::Float16, differential: (Swift::Float16, Swift::Float16) -> Swift::Float16) {
|
|
852
|
+
return (lhs - rhs, { (dlhs, drhs) in dlhs - drhs })
|
|
853
|
+
}
|
|
854
|
+
@available(iOS 14.0, tvOS 14.0, watchOS 7.0, *)
|
|
855
|
+
@derivative(of: -=, wrt: (lhs, rhs))
|
|
856
|
+
@inlinable @_transparent internal static func _vjpSubtractAssign(_ lhs: inout Swift::Float16, _ rhs: Swift::Float16) -> (value: Swift::Void, pullback: (inout Swift::Float16) -> Swift::Float16) {
|
|
857
|
+
lhs -= rhs
|
|
858
|
+
return ((), { v in -v })
|
|
859
|
+
}
|
|
860
|
+
@available(iOS 14.0, tvOS 14.0, watchOS 7.0, *)
|
|
861
|
+
@derivative(of: -=, wrt: (lhs, rhs))
|
|
862
|
+
@inlinable @_transparent internal static func _jvpSubtractAssign(_ lhs: inout Swift::Float16, _ rhs: Swift::Float16) -> (value: Swift::Void, differential: (inout Swift::Float16, Swift::Float16) -> Swift::Void) {
|
|
863
|
+
lhs -= rhs
|
|
864
|
+
return ((), { $0 -= $1 })
|
|
865
|
+
}
|
|
866
|
+
@available(iOS 14.0, tvOS 14.0, watchOS 7.0, *)
|
|
867
|
+
@derivative(of: *, wrt: (lhs, rhs))
|
|
868
|
+
@inlinable @_transparent internal static func _vjpMultiply(lhs: Swift::Float16, rhs: Swift::Float16) -> (value: Swift::Float16, pullback: (Swift::Float16) -> (Swift::Float16, Swift::Float16)) {
|
|
869
|
+
return (lhs * rhs, { v in (rhs * v, lhs * v) })
|
|
870
|
+
}
|
|
871
|
+
@available(iOS 14.0, tvOS 14.0, watchOS 7.0, *)
|
|
872
|
+
@derivative(of: *, wrt: (lhs, rhs))
|
|
873
|
+
@inlinable @_transparent internal static func _jvpMultiply(lhs: Swift::Float16, rhs: Swift::Float16) -> (value: Swift::Float16, differential: (Swift::Float16, Swift::Float16) -> Swift::Float16) {
|
|
874
|
+
return (lhs * rhs, { (dlhs, drhs) in lhs * drhs + rhs * dlhs })
|
|
875
|
+
}
|
|
876
|
+
@available(iOS 14.0, tvOS 14.0, watchOS 7.0, *)
|
|
877
|
+
@derivative(of: *=, wrt: (lhs, rhs))
|
|
878
|
+
@inlinable @_transparent internal static func _vjpMultiplyAssign(_ lhs: inout Swift::Float16, _ rhs: Swift::Float16) -> (value: Swift::Void, pullback: (inout Swift::Float16) -> Swift::Float16) {
|
|
879
|
+
defer { lhs *= rhs }
|
|
880
|
+
return ((), { [lhs = lhs] v in
|
|
881
|
+
let drhs = lhs * v
|
|
882
|
+
v *= rhs
|
|
883
|
+
return drhs
|
|
884
|
+
})
|
|
885
|
+
}
|
|
886
|
+
@available(iOS 14.0, tvOS 14.0, watchOS 7.0, *)
|
|
887
|
+
@derivative(of: *=, wrt: (lhs, rhs))
|
|
888
|
+
@inlinable @_transparent internal static func _jvpMultiplyAssign(_ lhs: inout Swift::Float16, _ rhs: Swift::Float16) -> (value: Swift::Void, differential: (inout Swift::Float16, Swift::Float16) -> Swift::Void) {
|
|
889
|
+
let oldLhs = lhs
|
|
890
|
+
lhs *= rhs
|
|
891
|
+
return ((), { $0 = $0 * rhs + oldLhs * $1 })
|
|
892
|
+
}
|
|
893
|
+
@available(iOS 14.0, tvOS 14.0, watchOS 7.0, *)
|
|
894
|
+
@derivative(of: /, wrt: (lhs, rhs))
|
|
895
|
+
@inlinable @_transparent internal static func _vjpDivide(lhs: Swift::Float16, rhs: Swift::Float16) -> (value: Swift::Float16, pullback: (Swift::Float16) -> (Swift::Float16, Swift::Float16)) {
|
|
896
|
+
return (lhs / rhs, { v in (v / rhs, -lhs / (rhs * rhs) * v) })
|
|
897
|
+
}
|
|
898
|
+
@available(iOS 14.0, tvOS 14.0, watchOS 7.0, *)
|
|
899
|
+
@derivative(of: /, wrt: (lhs, rhs))
|
|
900
|
+
@inlinable @_transparent internal static func _jvpDivide(lhs: Swift::Float16, rhs: Swift::Float16) -> (value: Swift::Float16, differential: (Swift::Float16, Swift::Float16) -> Swift::Float16) {
|
|
901
|
+
return (lhs / rhs, { (dlhs, drhs) in dlhs / rhs - lhs / (rhs * rhs) * drhs })
|
|
902
|
+
}
|
|
903
|
+
@available(iOS 14.0, tvOS 14.0, watchOS 7.0, *)
|
|
904
|
+
@derivative(of: /=, wrt: (lhs, rhs))
|
|
905
|
+
@inlinable @_transparent internal static func _vjpDivideAssign(_ lhs: inout Swift::Float16, _ rhs: Swift::Float16) -> (value: Swift::Void, pullback: (inout Swift::Float16) -> Swift::Float16) {
|
|
906
|
+
defer { lhs /= rhs }
|
|
907
|
+
return ((), { [lhs = lhs] v in
|
|
908
|
+
let drhs = -lhs / (rhs * rhs) * v
|
|
909
|
+
v /= rhs
|
|
910
|
+
return drhs
|
|
911
|
+
})
|
|
912
|
+
}
|
|
913
|
+
@available(iOS 14.0, tvOS 14.0, watchOS 7.0, *)
|
|
914
|
+
@derivative(of: /=, wrt: (lhs, rhs))
|
|
915
|
+
@inlinable @_transparent internal static func _jvpDivideAssign(_ lhs: inout Swift::Float16, _ rhs: Swift::Float16) -> (value: Swift::Void, differential: (inout Swift::Float16, Swift::Float16) -> Swift::Void) {
|
|
916
|
+
let oldLhs = lhs
|
|
917
|
+
lhs /= rhs
|
|
918
|
+
return ((), { $0 = ($0 * rhs - oldLhs * $1) / (rhs * rhs) })
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
extension Swift::Float : _Differentiation::Differentiable {
|
|
922
|
+
public typealias TangentVector = Swift::Float
|
|
923
|
+
@inlinable public mutating func move(by offset: Swift::Float._Differentiation::TangentVector) {
|
|
924
|
+
self += offset
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
extension Swift::Float {
|
|
928
|
+
@available(iOS 14.0, tvOS 14.0, watchOS 7.0, *)
|
|
929
|
+
@derivative(of: init(_:), wrt: x)
|
|
930
|
+
@inlinable @_transparent internal static func _vjpInit(x: Swift::Float16) -> (value: Swift::Float, pullback: (Swift::Float) -> Swift::Float16) {
|
|
931
|
+
return (value: Float(x), pullback: { v in Float16(v) })
|
|
932
|
+
}
|
|
933
|
+
@available(iOS 14.0, tvOS 14.0, watchOS 7.0, *)
|
|
934
|
+
@derivative(of: init(_:), wrt: x)
|
|
935
|
+
@inlinable @_transparent internal static func _jvpInit(x: Swift::Float16) -> (value: Swift::Float, differential: (Swift::Float16) -> Swift::Float) {
|
|
936
|
+
return (value: Float(x), differential: { dx in Float(dx) })
|
|
937
|
+
}
|
|
938
|
+
@derivative(of: init(_:), wrt: x)
|
|
939
|
+
@inlinable @_transparent internal static func _vjpInit(x: Swift::Float) -> (value: Swift::Float, pullback: (Swift::Float) -> Swift::Float) {
|
|
940
|
+
return (value: Float(x), pullback: { v in Float(v) })
|
|
941
|
+
}
|
|
942
|
+
@derivative(of: init(_:), wrt: x)
|
|
943
|
+
@inlinable @_transparent internal static func _jvpInit(x: Swift::Float) -> (value: Swift::Float, differential: (Swift::Float) -> Swift::Float) {
|
|
944
|
+
return (value: Float(x), differential: { dx in Float(dx) })
|
|
945
|
+
}
|
|
946
|
+
@derivative(of: init(_:), wrt: x)
|
|
947
|
+
@inlinable @_transparent internal static func _vjpInit(x: Swift::Double) -> (value: Swift::Float, pullback: (Swift::Float) -> Swift::Double) {
|
|
948
|
+
return (value: Float(x), pullback: { v in Double(v) })
|
|
949
|
+
}
|
|
950
|
+
@derivative(of: init(_:), wrt: x)
|
|
951
|
+
@inlinable @_transparent internal static func _jvpInit(x: Swift::Double) -> (value: Swift::Float, differential: (Swift::Double) -> Swift::Float) {
|
|
952
|
+
return (value: Float(x), differential: { dx in Float(dx) })
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
extension Swift::Float {
|
|
956
|
+
@derivative(of: -, wrt: x)
|
|
957
|
+
@inlinable @_transparent internal static func _vjpNegate(x: Swift::Float) -> (value: Swift::Float, pullback: (Swift::Float) -> Swift::Float) {
|
|
958
|
+
return (-x, { v in -v })
|
|
959
|
+
}
|
|
960
|
+
@derivative(of: -, wrt: x)
|
|
961
|
+
@inlinable @_transparent internal static func _jvpNegate(x: Swift::Float) -> (value: Swift::Float, differential: (Swift::Float) -> Swift::Float) {
|
|
962
|
+
return (-x, { dx in -dx })
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
extension Swift::Float {
|
|
966
|
+
@derivative(of: +, wrt: (lhs, rhs))
|
|
967
|
+
@inlinable @_transparent internal static func _vjpAdd(lhs: Swift::Float, rhs: Swift::Float) -> (value: Swift::Float, pullback: (Swift::Float) -> (Swift::Float, Swift::Float)) {
|
|
968
|
+
return (lhs + rhs, { v in (v, v) })
|
|
969
|
+
}
|
|
970
|
+
@derivative(of: +, wrt: (lhs, rhs))
|
|
971
|
+
@inlinable @_transparent internal static func _jvpAdd(lhs: Swift::Float, rhs: Swift::Float) -> (value: Swift::Float, differential: (Swift::Float, Swift::Float) -> Swift::Float) {
|
|
972
|
+
return (lhs + rhs, { (dlhs, drhs) in dlhs + drhs })
|
|
973
|
+
}
|
|
974
|
+
@derivative(of: +=, wrt: (lhs, rhs))
|
|
975
|
+
@inlinable @_transparent internal static func _vjpAddAssign(_ lhs: inout Swift::Float, _ rhs: Swift::Float) -> (value: Swift::Void, pullback: (inout Swift::Float) -> Swift::Float) {
|
|
976
|
+
lhs += rhs
|
|
977
|
+
return ((), { v in v })
|
|
978
|
+
}
|
|
979
|
+
@derivative(of: +=, wrt: (lhs, rhs))
|
|
980
|
+
@inlinable @_transparent internal static func _jvpAddAssign(_ lhs: inout Swift::Float, _ rhs: Swift::Float) -> (value: Swift::Void, differential: (inout Swift::Float, Swift::Float) -> Swift::Void) {
|
|
981
|
+
lhs += rhs
|
|
982
|
+
return ((), { $0 += $1 })
|
|
983
|
+
}
|
|
984
|
+
@derivative(of: -, wrt: (lhs, rhs))
|
|
985
|
+
@inlinable @_transparent internal static func _vjpSubtract(lhs: Swift::Float, rhs: Swift::Float) -> (value: Swift::Float, pullback: (Swift::Float) -> (Swift::Float, Swift::Float)) {
|
|
986
|
+
return (lhs - rhs, { v in (v, -v) })
|
|
987
|
+
}
|
|
988
|
+
@derivative(of: -, wrt: (lhs, rhs))
|
|
989
|
+
@inlinable @_transparent internal static func _jvpSubtract(lhs: Swift::Float, rhs: Swift::Float) -> (value: Swift::Float, differential: (Swift::Float, Swift::Float) -> Swift::Float) {
|
|
990
|
+
return (lhs - rhs, { (dlhs, drhs) in dlhs - drhs })
|
|
991
|
+
}
|
|
992
|
+
@derivative(of: -=, wrt: (lhs, rhs))
|
|
993
|
+
@inlinable @_transparent internal static func _vjpSubtractAssign(_ lhs: inout Swift::Float, _ rhs: Swift::Float) -> (value: Swift::Void, pullback: (inout Swift::Float) -> Swift::Float) {
|
|
994
|
+
lhs -= rhs
|
|
995
|
+
return ((), { v in -v })
|
|
996
|
+
}
|
|
997
|
+
@derivative(of: -=, wrt: (lhs, rhs))
|
|
998
|
+
@inlinable @_transparent internal static func _jvpSubtractAssign(_ lhs: inout Swift::Float, _ rhs: Swift::Float) -> (value: Swift::Void, differential: (inout Swift::Float, Swift::Float) -> Swift::Void) {
|
|
999
|
+
lhs -= rhs
|
|
1000
|
+
return ((), { $0 -= $1 })
|
|
1001
|
+
}
|
|
1002
|
+
@derivative(of: *, wrt: (lhs, rhs))
|
|
1003
|
+
@inlinable @_transparent internal static func _vjpMultiply(lhs: Swift::Float, rhs: Swift::Float) -> (value: Swift::Float, pullback: (Swift::Float) -> (Swift::Float, Swift::Float)) {
|
|
1004
|
+
return (lhs * rhs, { v in (rhs * v, lhs * v) })
|
|
1005
|
+
}
|
|
1006
|
+
@derivative(of: *, wrt: (lhs, rhs))
|
|
1007
|
+
@inlinable @_transparent internal static func _jvpMultiply(lhs: Swift::Float, rhs: Swift::Float) -> (value: Swift::Float, differential: (Swift::Float, Swift::Float) -> Swift::Float) {
|
|
1008
|
+
return (lhs * rhs, { (dlhs, drhs) in lhs * drhs + rhs * dlhs })
|
|
1009
|
+
}
|
|
1010
|
+
@derivative(of: *=, wrt: (lhs, rhs))
|
|
1011
|
+
@inlinable @_transparent internal static func _vjpMultiplyAssign(_ lhs: inout Swift::Float, _ rhs: Swift::Float) -> (value: Swift::Void, pullback: (inout Swift::Float) -> Swift::Float) {
|
|
1012
|
+
defer { lhs *= rhs }
|
|
1013
|
+
return ((), { [lhs = lhs] v in
|
|
1014
|
+
let drhs = lhs * v
|
|
1015
|
+
v *= rhs
|
|
1016
|
+
return drhs
|
|
1017
|
+
})
|
|
1018
|
+
}
|
|
1019
|
+
@derivative(of: *=, wrt: (lhs, rhs))
|
|
1020
|
+
@inlinable @_transparent internal static func _jvpMultiplyAssign(_ lhs: inout Swift::Float, _ rhs: Swift::Float) -> (value: Swift::Void, differential: (inout Swift::Float, Swift::Float) -> Swift::Void) {
|
|
1021
|
+
let oldLhs = lhs
|
|
1022
|
+
lhs *= rhs
|
|
1023
|
+
return ((), { $0 = $0 * rhs + oldLhs * $1 })
|
|
1024
|
+
}
|
|
1025
|
+
@derivative(of: /, wrt: (lhs, rhs))
|
|
1026
|
+
@inlinable @_transparent internal static func _vjpDivide(lhs: Swift::Float, rhs: Swift::Float) -> (value: Swift::Float, pullback: (Swift::Float) -> (Swift::Float, Swift::Float)) {
|
|
1027
|
+
return (lhs / rhs, { v in (v / rhs, -lhs / (rhs * rhs) * v) })
|
|
1028
|
+
}
|
|
1029
|
+
@derivative(of: /, wrt: (lhs, rhs))
|
|
1030
|
+
@inlinable @_transparent internal static func _jvpDivide(lhs: Swift::Float, rhs: Swift::Float) -> (value: Swift::Float, differential: (Swift::Float, Swift::Float) -> Swift::Float) {
|
|
1031
|
+
return (lhs / rhs, { (dlhs, drhs) in dlhs / rhs - lhs / (rhs * rhs) * drhs })
|
|
1032
|
+
}
|
|
1033
|
+
@derivative(of: /=, wrt: (lhs, rhs))
|
|
1034
|
+
@inlinable @_transparent internal static func _vjpDivideAssign(_ lhs: inout Swift::Float, _ rhs: Swift::Float) -> (value: Swift::Void, pullback: (inout Swift::Float) -> Swift::Float) {
|
|
1035
|
+
defer { lhs /= rhs }
|
|
1036
|
+
return ((), { [lhs = lhs] v in
|
|
1037
|
+
let drhs = -lhs / (rhs * rhs) * v
|
|
1038
|
+
v /= rhs
|
|
1039
|
+
return drhs
|
|
1040
|
+
})
|
|
1041
|
+
}
|
|
1042
|
+
@derivative(of: /=, wrt: (lhs, rhs))
|
|
1043
|
+
@inlinable @_transparent internal static func _jvpDivideAssign(_ lhs: inout Swift::Float, _ rhs: Swift::Float) -> (value: Swift::Void, differential: (inout Swift::Float, Swift::Float) -> Swift::Void) {
|
|
1044
|
+
let oldLhs = lhs
|
|
1045
|
+
lhs /= rhs
|
|
1046
|
+
return ((), { $0 = ($0 * rhs - oldLhs * $1) / (rhs * rhs) })
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
extension Swift::Double : _Differentiation::Differentiable {
|
|
1050
|
+
public typealias TangentVector = Swift::Double
|
|
1051
|
+
@inlinable public mutating func move(by offset: Swift::Double._Differentiation::TangentVector) {
|
|
1052
|
+
self += offset
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
extension Swift::Double {
|
|
1056
|
+
@available(iOS 14.0, tvOS 14.0, watchOS 7.0, *)
|
|
1057
|
+
@derivative(of: init(_:), wrt: x)
|
|
1058
|
+
@inlinable @_transparent internal static func _vjpInit(x: Swift::Float16) -> (value: Swift::Double, pullback: (Swift::Double) -> Swift::Float16) {
|
|
1059
|
+
return (value: Double(x), pullback: { v in Float16(v) })
|
|
1060
|
+
}
|
|
1061
|
+
@available(iOS 14.0, tvOS 14.0, watchOS 7.0, *)
|
|
1062
|
+
@derivative(of: init(_:), wrt: x)
|
|
1063
|
+
@inlinable @_transparent internal static func _jvpInit(x: Swift::Float16) -> (value: Swift::Double, differential: (Swift::Float16) -> Swift::Double) {
|
|
1064
|
+
return (value: Double(x), differential: { dx in Double(dx) })
|
|
1065
|
+
}
|
|
1066
|
+
@derivative(of: init(_:), wrt: x)
|
|
1067
|
+
@inlinable @_transparent internal static func _vjpInit(x: Swift::Float) -> (value: Swift::Double, pullback: (Swift::Double) -> Swift::Float) {
|
|
1068
|
+
return (value: Double(x), pullback: { v in Float(v) })
|
|
1069
|
+
}
|
|
1070
|
+
@derivative(of: init(_:), wrt: x)
|
|
1071
|
+
@inlinable @_transparent internal static func _jvpInit(x: Swift::Float) -> (value: Swift::Double, differential: (Swift::Float) -> Swift::Double) {
|
|
1072
|
+
return (value: Double(x), differential: { dx in Double(dx) })
|
|
1073
|
+
}
|
|
1074
|
+
@derivative(of: init(_:), wrt: x)
|
|
1075
|
+
@inlinable @_transparent internal static func _vjpInit(x: Swift::Double) -> (value: Swift::Double, pullback: (Swift::Double) -> Swift::Double) {
|
|
1076
|
+
return (value: Double(x), pullback: { v in Double(v) })
|
|
1077
|
+
}
|
|
1078
|
+
@derivative(of: init(_:), wrt: x)
|
|
1079
|
+
@inlinable @_transparent internal static func _jvpInit(x: Swift::Double) -> (value: Swift::Double, differential: (Swift::Double) -> Swift::Double) {
|
|
1080
|
+
return (value: Double(x), differential: { dx in Double(dx) })
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
extension Swift::Double {
|
|
1084
|
+
@derivative(of: -, wrt: x)
|
|
1085
|
+
@inlinable @_transparent internal static func _vjpNegate(x: Swift::Double) -> (value: Swift::Double, pullback: (Swift::Double) -> Swift::Double) {
|
|
1086
|
+
return (-x, { v in -v })
|
|
1087
|
+
}
|
|
1088
|
+
@derivative(of: -, wrt: x)
|
|
1089
|
+
@inlinable @_transparent internal static func _jvpNegate(x: Swift::Double) -> (value: Swift::Double, differential: (Swift::Double) -> Swift::Double) {
|
|
1090
|
+
return (-x, { dx in -dx })
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
extension Swift::Double {
|
|
1094
|
+
@derivative(of: +, wrt: (lhs, rhs))
|
|
1095
|
+
@inlinable @_transparent internal static func _vjpAdd(lhs: Swift::Double, rhs: Swift::Double) -> (value: Swift::Double, pullback: (Swift::Double) -> (Swift::Double, Swift::Double)) {
|
|
1096
|
+
return (lhs + rhs, { v in (v, v) })
|
|
1097
|
+
}
|
|
1098
|
+
@derivative(of: +, wrt: (lhs, rhs))
|
|
1099
|
+
@inlinable @_transparent internal static func _jvpAdd(lhs: Swift::Double, rhs: Swift::Double) -> (value: Swift::Double, differential: (Swift::Double, Swift::Double) -> Swift::Double) {
|
|
1100
|
+
return (lhs + rhs, { (dlhs, drhs) in dlhs + drhs })
|
|
1101
|
+
}
|
|
1102
|
+
@derivative(of: +=, wrt: (lhs, rhs))
|
|
1103
|
+
@inlinable @_transparent internal static func _vjpAddAssign(_ lhs: inout Swift::Double, _ rhs: Swift::Double) -> (value: Swift::Void, pullback: (inout Swift::Double) -> Swift::Double) {
|
|
1104
|
+
lhs += rhs
|
|
1105
|
+
return ((), { v in v })
|
|
1106
|
+
}
|
|
1107
|
+
@derivative(of: +=, wrt: (lhs, rhs))
|
|
1108
|
+
@inlinable @_transparent internal static func _jvpAddAssign(_ lhs: inout Swift::Double, _ rhs: Swift::Double) -> (value: Swift::Void, differential: (inout Swift::Double, Swift::Double) -> Swift::Void) {
|
|
1109
|
+
lhs += rhs
|
|
1110
|
+
return ((), { $0 += $1 })
|
|
1111
|
+
}
|
|
1112
|
+
@derivative(of: -, wrt: (lhs, rhs))
|
|
1113
|
+
@inlinable @_transparent internal static func _vjpSubtract(lhs: Swift::Double, rhs: Swift::Double) -> (value: Swift::Double, pullback: (Swift::Double) -> (Swift::Double, Swift::Double)) {
|
|
1114
|
+
return (lhs - rhs, { v in (v, -v) })
|
|
1115
|
+
}
|
|
1116
|
+
@derivative(of: -, wrt: (lhs, rhs))
|
|
1117
|
+
@inlinable @_transparent internal static func _jvpSubtract(lhs: Swift::Double, rhs: Swift::Double) -> (value: Swift::Double, differential: (Swift::Double, Swift::Double) -> Swift::Double) {
|
|
1118
|
+
return (lhs - rhs, { (dlhs, drhs) in dlhs - drhs })
|
|
1119
|
+
}
|
|
1120
|
+
@derivative(of: -=, wrt: (lhs, rhs))
|
|
1121
|
+
@inlinable @_transparent internal static func _vjpSubtractAssign(_ lhs: inout Swift::Double, _ rhs: Swift::Double) -> (value: Swift::Void, pullback: (inout Swift::Double) -> Swift::Double) {
|
|
1122
|
+
lhs -= rhs
|
|
1123
|
+
return ((), { v in -v })
|
|
1124
|
+
}
|
|
1125
|
+
@derivative(of: -=, wrt: (lhs, rhs))
|
|
1126
|
+
@inlinable @_transparent internal static func _jvpSubtractAssign(_ lhs: inout Swift::Double, _ rhs: Swift::Double) -> (value: Swift::Void, differential: (inout Swift::Double, Swift::Double) -> Swift::Void) {
|
|
1127
|
+
lhs -= rhs
|
|
1128
|
+
return ((), { $0 -= $1 })
|
|
1129
|
+
}
|
|
1130
|
+
@derivative(of: *, wrt: (lhs, rhs))
|
|
1131
|
+
@inlinable @_transparent internal static func _vjpMultiply(lhs: Swift::Double, rhs: Swift::Double) -> (value: Swift::Double, pullback: (Swift::Double) -> (Swift::Double, Swift::Double)) {
|
|
1132
|
+
return (lhs * rhs, { v in (rhs * v, lhs * v) })
|
|
1133
|
+
}
|
|
1134
|
+
@derivative(of: *, wrt: (lhs, rhs))
|
|
1135
|
+
@inlinable @_transparent internal static func _jvpMultiply(lhs: Swift::Double, rhs: Swift::Double) -> (value: Swift::Double, differential: (Swift::Double, Swift::Double) -> Swift::Double) {
|
|
1136
|
+
return (lhs * rhs, { (dlhs, drhs) in lhs * drhs + rhs * dlhs })
|
|
1137
|
+
}
|
|
1138
|
+
@derivative(of: *=, wrt: (lhs, rhs))
|
|
1139
|
+
@inlinable @_transparent internal static func _vjpMultiplyAssign(_ lhs: inout Swift::Double, _ rhs: Swift::Double) -> (value: Swift::Void, pullback: (inout Swift::Double) -> Swift::Double) {
|
|
1140
|
+
defer { lhs *= rhs }
|
|
1141
|
+
return ((), { [lhs = lhs] v in
|
|
1142
|
+
let drhs = lhs * v
|
|
1143
|
+
v *= rhs
|
|
1144
|
+
return drhs
|
|
1145
|
+
})
|
|
1146
|
+
}
|
|
1147
|
+
@derivative(of: *=, wrt: (lhs, rhs))
|
|
1148
|
+
@inlinable @_transparent internal static func _jvpMultiplyAssign(_ lhs: inout Swift::Double, _ rhs: Swift::Double) -> (value: Swift::Void, differential: (inout Swift::Double, Swift::Double) -> Swift::Void) {
|
|
1149
|
+
let oldLhs = lhs
|
|
1150
|
+
lhs *= rhs
|
|
1151
|
+
return ((), { $0 = $0 * rhs + oldLhs * $1 })
|
|
1152
|
+
}
|
|
1153
|
+
@derivative(of: /, wrt: (lhs, rhs))
|
|
1154
|
+
@inlinable @_transparent internal static func _vjpDivide(lhs: Swift::Double, rhs: Swift::Double) -> (value: Swift::Double, pullback: (Swift::Double) -> (Swift::Double, Swift::Double)) {
|
|
1155
|
+
return (lhs / rhs, { v in (v / rhs, -lhs / (rhs * rhs) * v) })
|
|
1156
|
+
}
|
|
1157
|
+
@derivative(of: /, wrt: (lhs, rhs))
|
|
1158
|
+
@inlinable @_transparent internal static func _jvpDivide(lhs: Swift::Double, rhs: Swift::Double) -> (value: Swift::Double, differential: (Swift::Double, Swift::Double) -> Swift::Double) {
|
|
1159
|
+
return (lhs / rhs, { (dlhs, drhs) in dlhs / rhs - lhs / (rhs * rhs) * drhs })
|
|
1160
|
+
}
|
|
1161
|
+
@derivative(of: /=, wrt: (lhs, rhs))
|
|
1162
|
+
@inlinable @_transparent internal static func _vjpDivideAssign(_ lhs: inout Swift::Double, _ rhs: Swift::Double) -> (value: Swift::Void, pullback: (inout Swift::Double) -> Swift::Double) {
|
|
1163
|
+
defer { lhs /= rhs }
|
|
1164
|
+
return ((), { [lhs = lhs] v in
|
|
1165
|
+
let drhs = -lhs / (rhs * rhs) * v
|
|
1166
|
+
v /= rhs
|
|
1167
|
+
return drhs
|
|
1168
|
+
})
|
|
1169
|
+
}
|
|
1170
|
+
@derivative(of: /=, wrt: (lhs, rhs))
|
|
1171
|
+
@inlinable @_transparent internal static func _jvpDivideAssign(_ lhs: inout Swift::Double, _ rhs: Swift::Double) -> (value: Swift::Void, differential: (inout Swift::Double, Swift::Double) -> Swift::Void) {
|
|
1172
|
+
let oldLhs = lhs
|
|
1173
|
+
lhs /= rhs
|
|
1174
|
+
return ((), { $0 = ($0 * rhs - oldLhs * $1) / (rhs * rhs) })
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
extension Swift::FloatingPoint where Self : _Differentiation::Differentiable, Self == Self.TangentVector {
|
|
1178
|
+
@derivative(of: addingProduct, wrt: (self, lhs, rhs))
|
|
1179
|
+
@inlinable internal func _vjpAddingProduct(_ lhs: Self, _ rhs: Self) -> (value: Self, pullback: (Self) -> (Self, Self, Self)) {
|
|
1180
|
+
return (addingProduct(lhs, rhs), { v in (v, v * rhs, v * lhs) })
|
|
1181
|
+
}
|
|
1182
|
+
@derivative(of: squareRoot, wrt: self)
|
|
1183
|
+
@inlinable internal func _vjpSquareRoot() -> (value: Self, pullback: (Self) -> Self) {
|
|
1184
|
+
let y = squareRoot()
|
|
1185
|
+
return (y, { v in v / (2 * y) })
|
|
1186
|
+
}
|
|
1187
|
+
@derivative(of: minimum, wrt: (x, y))
|
|
1188
|
+
@inlinable internal static func _vjpMinimum(_ x: Self, _ y: Self) -> (value: Self, pullback: (Self.TangentVector) -> (Self.TangentVector, Self.TangentVector)) {
|
|
1189
|
+
if x <= y || y.isNaN { return (x, { v in (v, .zero) }) }
|
|
1190
|
+
return (y, { v in (.zero, v) })
|
|
1191
|
+
}
|
|
1192
|
+
@derivative(of: maximum, wrt: (x, y))
|
|
1193
|
+
@inlinable internal static func _vjpMaximum(_ x: Self, _ y: Self) -> (value: Self, pullback: (Self.TangentVector) -> (Self.TangentVector, Self.TangentVector)) {
|
|
1194
|
+
if x > y || y.isNaN { return (x, { v in (v, .zero) }) }
|
|
1195
|
+
return (y, { v in (.zero, v) })
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
@derivative(of: fma, wrt: (x, y, z))
|
|
1199
|
+
@inlinable internal func _jvpFma<T>(_ x: T, _ y: T, _ z: T) -> (value: T, differential: (T, T, T) -> T) where T : Swift::FloatingPoint, T : _Differentiation::Differentiable, T == T.TangentVector {
|
|
1200
|
+
return (fma(x, y, z), { (dx, dy, dz) in dx * y + dy * x + dz })
|
|
1201
|
+
}
|
|
1202
|
+
@derivative(of: fma, wrt: (x, y, z))
|
|
1203
|
+
@inlinable internal func _vjpFma<T>(_ x: T, _ y: T, _ z: T) -> (value: T, pullback: (T) -> (T, T, T)) where T : Swift::FloatingPoint, T : _Differentiation::Differentiable, T == T.TangentVector {
|
|
1204
|
+
return (fma(x, y, z), { v in (v * y, v * x, v) })
|
|
1205
|
+
}
|
|
1206
|
+
@derivative(of: remainder, wrt: (x, y))
|
|
1207
|
+
@inlinable internal func _jvpRemainder<T>(_ x: T, _ y: T) -> (value: T, differential: (T, T) -> T) where T : Swift::FloatingPoint, T : _Differentiation::Differentiable, T == T.TangentVector {
|
|
1208
|
+
fatalError("""
|
|
1209
|
+
Unimplemented JVP for 'remainder(_:)'. \
|
|
1210
|
+
https://bugs.swift.org/browse/TF-1108 tracks this issue
|
|
1211
|
+
""")
|
|
1212
|
+
}
|
|
1213
|
+
@derivative(of: remainder, wrt: (x, y))
|
|
1214
|
+
@inlinable internal func _vjpRemainder<T>(_ x: T, _ y: T) -> (value: T, pullback: (T) -> (T, T)) where T : Swift::FloatingPoint, T : _Differentiation::Differentiable, T == T.TangentVector {
|
|
1215
|
+
return (remainder(x, y), { v in (v, -v * ((x / y).rounded(.toNearestOrEven))) })
|
|
1216
|
+
}
|
|
1217
|
+
@derivative(of: fmod, wrt: (x, y))
|
|
1218
|
+
@inlinable internal func _jvpFmod<T>(_ x: T, _ y: T) -> (value: T, differential: (T, T) -> T) where T : Swift::FloatingPoint, T : _Differentiation::Differentiable, T == T.TangentVector {
|
|
1219
|
+
fatalError("""
|
|
1220
|
+
Unimplemented JVP for 'fmod(_:)'. \
|
|
1221
|
+
https://bugs.swift.org/browse/TF-1108 tracks this issue
|
|
1222
|
+
""")
|
|
1223
|
+
}
|
|
1224
|
+
@derivative(of: fmod, wrt: (x, y))
|
|
1225
|
+
@inlinable internal func _vjpFmod<T>(_ x: T, _ y: T) -> (value: T, pullback: (T) -> (T, T)) where T : Swift::FloatingPoint, T : _Differentiation::Differentiable, T == T.TangentVector {
|
|
1226
|
+
return (fmod(x, y), { v in (v, -v * ((x / y).rounded(.towardZero))) })
|
|
1227
|
+
}
|
|
1228
|
+
@derivative(of: sqrt, wrt: x)
|
|
1229
|
+
@inlinable internal func _jvpSqrt<T>(_ x: T) -> (value: T, differential: (T) -> T) where T : Swift::FloatingPoint, T : _Differentiation::Differentiable, T == T.TangentVector {
|
|
1230
|
+
let value = sqrt(x)
|
|
1231
|
+
return (value, { v in v / (2 * value) })
|
|
1232
|
+
}
|
|
1233
|
+
@derivative(of: ceil, wrt: x)
|
|
1234
|
+
@inlinable internal func _jvpCeil<T>(_ x: T) -> (value: T, differential: (T) -> T) where T : Swift::FloatingPoint, T : _Differentiation::Differentiable, T == T.TangentVector {
|
|
1235
|
+
return (ceil(x), { v in 0 })
|
|
1236
|
+
}
|
|
1237
|
+
@derivative(of: floor, wrt: x)
|
|
1238
|
+
@inlinable internal func _jvpFloor<T>(_ x: T) -> (value: T, differential: (T) -> T) where T : Swift::FloatingPoint, T : _Differentiation::Differentiable, T == T.TangentVector {
|
|
1239
|
+
return (floor(x), { v in 0 })
|
|
1240
|
+
}
|
|
1241
|
+
@derivative(of: round, wrt: x)
|
|
1242
|
+
@inlinable internal func _jvpRound<T>(_ x: T) -> (value: T, differential: (T) -> T) where T : Swift::FloatingPoint, T : _Differentiation::Differentiable, T == T.TangentVector {
|
|
1243
|
+
return (round(x), { v in 0 })
|
|
1244
|
+
}
|
|
1245
|
+
@derivative(of: trunc, wrt: x)
|
|
1246
|
+
@inlinable internal func _jvpTrunc<T>(_ x: T) -> (value: T, differential: (T) -> T) where T : Swift::FloatingPoint, T : _Differentiation::Differentiable, T == T.TangentVector {
|
|
1247
|
+
return (trunc(x), { v in 0 })
|
|
1248
|
+
}
|
|
1249
|
+
@derivative(of: sqrt, wrt: x)
|
|
1250
|
+
@inlinable internal func _vjpSqrt<T>(_ x: T) -> (value: T, pullback: (T) -> T) where T : Swift::FloatingPoint, T : _Differentiation::Differentiable, T == T.TangentVector {
|
|
1251
|
+
let value = sqrt(x)
|
|
1252
|
+
return (value, { v in v / (2 * value) })
|
|
1253
|
+
}
|
|
1254
|
+
@derivative(of: ceil, wrt: x)
|
|
1255
|
+
@inlinable internal func _vjpCeil<T>(_ x: T) -> (value: T, pullback: (T) -> T) where T : Swift::FloatingPoint, T : _Differentiation::Differentiable, T == T.TangentVector {
|
|
1256
|
+
return (ceil(x), { v in 0 })
|
|
1257
|
+
}
|
|
1258
|
+
@derivative(of: floor, wrt: x)
|
|
1259
|
+
@inlinable internal func _vjpFloor<T>(_ x: T) -> (value: T, pullback: (T) -> T) where T : Swift::FloatingPoint, T : _Differentiation::Differentiable, T == T.TangentVector {
|
|
1260
|
+
return (floor(x), { v in 0 })
|
|
1261
|
+
}
|
|
1262
|
+
@derivative(of: round, wrt: x)
|
|
1263
|
+
@inlinable internal func _vjpRound<T>(_ x: T) -> (value: T, pullback: (T) -> T) where T : Swift::FloatingPoint, T : _Differentiation::Differentiable, T == T.TangentVector {
|
|
1264
|
+
return (round(x), { v in 0 })
|
|
1265
|
+
}
|
|
1266
|
+
@derivative(of: trunc, wrt: x)
|
|
1267
|
+
@inlinable internal func _vjpTrunc<T>(_ x: T) -> (value: T, pullback: (T) -> T) where T : Swift::FloatingPoint, T : _Differentiation::Differentiable, T == T.TangentVector {
|
|
1268
|
+
return (trunc(x), { v in 0 })
|
|
1269
|
+
}
|
|
1270
|
+
@derivative(of: fma, wrt: (x, y, z))
|
|
1271
|
+
@inlinable internal func _jvpFma(_ x: Swift::Double, _ y: Swift::Double, _ z: Swift::Double) -> (value: Swift::Double, differential: (Swift::Double, Swift::Double, Swift::Double) -> Swift::Double) {
|
|
1272
|
+
return (fma(x, y, z), { (dx, dy, dz) in dx * y + dy * x + dz })
|
|
1273
|
+
}
|
|
1274
|
+
@derivative(of: fma, wrt: (x, y, z))
|
|
1275
|
+
@inlinable internal func _vjpFma(_ x: Swift::Double, _ y: Swift::Double, _ z: Swift::Double) -> (value: Swift::Double, pullback: (Swift::Double) -> (Swift::Double, Swift::Double, Swift::Double)) {
|
|
1276
|
+
return (fma(x, y, z), { v in (v * y, v * x, v) })
|
|
1277
|
+
}
|
|
1278
|
+
@derivative(of: remainder, wrt: (x, y))
|
|
1279
|
+
@inlinable internal func _jvpRemainder(_ x: Swift::Double, _ y: Swift::Double) -> (value: Swift::Double, differential: (Swift::Double, Swift::Double) -> Swift::Double) {
|
|
1280
|
+
fatalError("""
|
|
1281
|
+
Unimplemented JVP for 'remainder(_:)'. \
|
|
1282
|
+
https://bugs.swift.org/browse/TF-1108 tracks this issue
|
|
1283
|
+
""")
|
|
1284
|
+
}
|
|
1285
|
+
@derivative(of: remainder, wrt: (x, y))
|
|
1286
|
+
@inlinable internal func _vjpRemainder(_ x: Swift::Double, _ y: Swift::Double) -> (value: Swift::Double, pullback: (Swift::Double) -> (Swift::Double, Swift::Double)) {
|
|
1287
|
+
return (remainder(x, y), { v in (v, -v * ((x / y).rounded(.toNearestOrEven))) })
|
|
1288
|
+
}
|
|
1289
|
+
@derivative(of: fmod, wrt: (x, y))
|
|
1290
|
+
@inlinable internal func _jvpFmod(_ x: Swift::Double, _ y: Swift::Double) -> (value: Swift::Double, differential: (Swift::Double, Swift::Double) -> Swift::Double) {
|
|
1291
|
+
fatalError("""
|
|
1292
|
+
Unimplemented JVP for 'fmod(_:)'. \
|
|
1293
|
+
https://bugs.swift.org/browse/TF-1108 tracks this issue
|
|
1294
|
+
""")
|
|
1295
|
+
}
|
|
1296
|
+
@derivative(of: fmod, wrt: (x, y))
|
|
1297
|
+
@inlinable internal func _vjpFmod(_ x: Swift::Double, _ y: Swift::Double) -> (value: Swift::Double, pullback: (Swift::Double) -> (Swift::Double, Swift::Double)) {
|
|
1298
|
+
return (fmod(x, y), { v in (v, -v * ((x / y).rounded(.towardZero))) })
|
|
1299
|
+
}
|
|
1300
|
+
@derivative(of: sqrt, wrt: x)
|
|
1301
|
+
@inlinable internal func _jvpSqrt(_ x: Swift::Double) -> (value: Swift::Double, differential: (Swift::Double) -> Swift::Double) {
|
|
1302
|
+
let value = sqrt(x)
|
|
1303
|
+
return (value, { v in v / (2 * value) })
|
|
1304
|
+
}
|
|
1305
|
+
@derivative(of: ceil, wrt: x)
|
|
1306
|
+
@inlinable internal func _jvpCeil(_ x: Swift::Double) -> (value: Swift::Double, differential: (Swift::Double) -> Swift::Double) {
|
|
1307
|
+
return (ceil(x), { v in 0 })
|
|
1308
|
+
}
|
|
1309
|
+
@derivative(of: floor, wrt: x)
|
|
1310
|
+
@inlinable internal func _jvpFloor(_ x: Swift::Double) -> (value: Swift::Double, differential: (Swift::Double) -> Swift::Double) {
|
|
1311
|
+
return (floor(x), { v in 0 })
|
|
1312
|
+
}
|
|
1313
|
+
@derivative(of: round, wrt: x)
|
|
1314
|
+
@inlinable internal func _jvpRound(_ x: Swift::Double) -> (value: Swift::Double, differential: (Swift::Double) -> Swift::Double) {
|
|
1315
|
+
return (round(x), { v in 0 })
|
|
1316
|
+
}
|
|
1317
|
+
@derivative(of: trunc, wrt: x)
|
|
1318
|
+
@inlinable internal func _jvpTrunc(_ x: Swift::Double) -> (value: Swift::Double, differential: (Swift::Double) -> Swift::Double) {
|
|
1319
|
+
return (trunc(x), { v in 0 })
|
|
1320
|
+
}
|
|
1321
|
+
@derivative(of: sqrt, wrt: x)
|
|
1322
|
+
@inlinable internal func _vjpSqrt(_ x: Swift::Double) -> (value: Swift::Double, pullback: (Swift::Double) -> Swift::Double) {
|
|
1323
|
+
let value = sqrt(x)
|
|
1324
|
+
return (value, { v in v / (2 * value) })
|
|
1325
|
+
}
|
|
1326
|
+
@derivative(of: ceil, wrt: x)
|
|
1327
|
+
@inlinable internal func _vjpCeil(_ x: Swift::Double) -> (value: Swift::Double, pullback: (Swift::Double) -> Swift::Double) {
|
|
1328
|
+
return (ceil(x), { v in 0 })
|
|
1329
|
+
}
|
|
1330
|
+
@derivative(of: floor, wrt: x)
|
|
1331
|
+
@inlinable internal func _vjpFloor(_ x: Swift::Double) -> (value: Swift::Double, pullback: (Swift::Double) -> Swift::Double) {
|
|
1332
|
+
return (floor(x), { v in 0 })
|
|
1333
|
+
}
|
|
1334
|
+
@derivative(of: round, wrt: x)
|
|
1335
|
+
@inlinable internal func _vjpRound(_ x: Swift::Double) -> (value: Swift::Double, pullback: (Swift::Double) -> Swift::Double) {
|
|
1336
|
+
return (round(x), { v in 0 })
|
|
1337
|
+
}
|
|
1338
|
+
@derivative(of: trunc, wrt: x)
|
|
1339
|
+
@inlinable internal func _vjpTrunc(_ x: Swift::Double) -> (value: Swift::Double, pullback: (Swift::Double) -> Swift::Double) {
|
|
1340
|
+
return (trunc(x), { v in 0 })
|
|
1341
|
+
}
|
|
1342
|
+
@derivative(of: exp, wrt: x)
|
|
1343
|
+
@inlinable internal func _jvpExp(_ x: Swift::Float) -> (value: Swift::Float, differential: (Swift::Float) -> Swift::Float) {
|
|
1344
|
+
let value = exp(x)
|
|
1345
|
+
return (value, { v in value * v })
|
|
1346
|
+
}
|
|
1347
|
+
@derivative(of: exp2, wrt: x)
|
|
1348
|
+
@inlinable internal func _jvpExp2(_ x: Swift::Float) -> (value: Swift::Float, differential: (Swift::Float) -> Swift::Float) {
|
|
1349
|
+
let value = exp2(x)
|
|
1350
|
+
return (value, { v in v * Float(M_LN2) * value })
|
|
1351
|
+
}
|
|
1352
|
+
@derivative(of: log, wrt: x)
|
|
1353
|
+
@inlinable internal func _jvpLog(_ x: Swift::Float) -> (value: Swift::Float, differential: (Swift::Float) -> Swift::Float) {
|
|
1354
|
+
return (log(x), { v in v / x })
|
|
1355
|
+
}
|
|
1356
|
+
@derivative(of: log10, wrt: x)
|
|
1357
|
+
@inlinable internal func _jvpLog10(_ x: Swift::Float) -> (value: Swift::Float, differential: (Swift::Float) -> Swift::Float) {
|
|
1358
|
+
return (log10(x), { v in v * Float(M_LOG10E) / x })
|
|
1359
|
+
}
|
|
1360
|
+
@derivative(of: log2, wrt: x)
|
|
1361
|
+
@inlinable internal func _jvpLog2(_ x: Swift::Float) -> (value: Swift::Float, differential: (Swift::Float) -> Swift::Float) {
|
|
1362
|
+
return (log2(x), { v in v / (Float(M_LN2) * x) })
|
|
1363
|
+
}
|
|
1364
|
+
@derivative(of: sin, wrt: x)
|
|
1365
|
+
@inlinable internal func _jvpSin(_ x: Swift::Float) -> (value: Swift::Float, differential: (Swift::Float) -> Swift::Float) {
|
|
1366
|
+
return (sin(x), { v in v * cos(x) })
|
|
1367
|
+
}
|
|
1368
|
+
@derivative(of: cos, wrt: x)
|
|
1369
|
+
@inlinable internal func _jvpCos(_ x: Swift::Float) -> (value: Swift::Float, differential: (Swift::Float) -> Swift::Float) {
|
|
1370
|
+
return (cos(x), { v in -v * sin(x) })
|
|
1371
|
+
}
|
|
1372
|
+
@derivative(of: tan, wrt: x)
|
|
1373
|
+
@inlinable internal func _jvpTan(_ x: Swift::Float) -> (value: Swift::Float, differential: (Swift::Float) -> Swift::Float) {
|
|
1374
|
+
let value = tan(x)
|
|
1375
|
+
return (value, { v in v * (1 + value * value) })
|
|
1376
|
+
}
|
|
1377
|
+
@derivative(of: asin, wrt: x)
|
|
1378
|
+
@inlinable internal func _jvpAsin(_ x: Swift::Float) -> (value: Swift::Float, differential: (Swift::Float) -> Swift::Float) {
|
|
1379
|
+
return (asin(x), { v in v / sqrt(1 - x * x) })
|
|
1380
|
+
}
|
|
1381
|
+
@derivative(of: acos, wrt: x)
|
|
1382
|
+
@inlinable internal func _jvpAcos(_ x: Swift::Float) -> (value: Swift::Float, differential: (Swift::Float) -> Swift::Float) {
|
|
1383
|
+
return (acos(x), { v in -v / sqrt(1 - x * x) })
|
|
1384
|
+
}
|
|
1385
|
+
@derivative(of: atan, wrt: x)
|
|
1386
|
+
@inlinable internal func _jvpAtan(_ x: Swift::Float) -> (value: Swift::Float, differential: (Swift::Float) -> Swift::Float) {
|
|
1387
|
+
return (atan(x), { v in v / (1 + x * x) })
|
|
1388
|
+
}
|
|
1389
|
+
@derivative(of: sinh, wrt: x)
|
|
1390
|
+
@inlinable internal func _jvpSinh(_ x: Swift::Float) -> (value: Swift::Float, differential: (Swift::Float) -> Swift::Float) {
|
|
1391
|
+
return (sinh(x), { v in v * cosh(x) })
|
|
1392
|
+
}
|
|
1393
|
+
@derivative(of: cosh, wrt: x)
|
|
1394
|
+
@inlinable internal func _jvpCosh(_ x: Swift::Float) -> (value: Swift::Float, differential: (Swift::Float) -> Swift::Float) {
|
|
1395
|
+
return (cosh(x), { v in v * sinh(x) })
|
|
1396
|
+
}
|
|
1397
|
+
@derivative(of: tanh, wrt: x)
|
|
1398
|
+
@inlinable internal func _jvpTanh(_ x: Swift::Float) -> (value: Swift::Float, differential: (Swift::Float) -> Swift::Float) {
|
|
1399
|
+
let value = tanh(x)
|
|
1400
|
+
return (value, { v in v * (1 - value * value) })
|
|
1401
|
+
}
|
|
1402
|
+
@derivative(of: asinh, wrt: x)
|
|
1403
|
+
@inlinable internal func _jvpAsinh(_ x: Swift::Float) -> (value: Swift::Float, differential: (Swift::Float) -> Swift::Float) {
|
|
1404
|
+
return (asinh(x), { v in v / sqrt(1 + x * x) })
|
|
1405
|
+
}
|
|
1406
|
+
@derivative(of: acosh, wrt: x)
|
|
1407
|
+
@inlinable internal func _jvpAcosh(_ x: Swift::Float) -> (value: Swift::Float, differential: (Swift::Float) -> Swift::Float) {
|
|
1408
|
+
return (acosh(x), { v in v / sqrt(x * x - 1) })
|
|
1409
|
+
}
|
|
1410
|
+
@derivative(of: atanh, wrt: x)
|
|
1411
|
+
@inlinable internal func _jvpAtanh(_ x: Swift::Float) -> (value: Swift::Float, differential: (Swift::Float) -> Swift::Float) {
|
|
1412
|
+
return (atanh(x), { v in v / (1 - x * x) })
|
|
1413
|
+
}
|
|
1414
|
+
@derivative(of: expm1, wrt: x)
|
|
1415
|
+
@inlinable internal func _jvpExpm1(_ x: Swift::Float) -> (value: Swift::Float, differential: (Swift::Float) -> Swift::Float) {
|
|
1416
|
+
return (expm1(x), { v in exp(x) * v })
|
|
1417
|
+
}
|
|
1418
|
+
@derivative(of: log1p, wrt: x)
|
|
1419
|
+
@inlinable internal func _jvpLog1p(_ x: Swift::Float) -> (value: Swift::Float, differential: (Swift::Float) -> Swift::Float) {
|
|
1420
|
+
return (log1p(x), { v in v / (x + 1) })
|
|
1421
|
+
}
|
|
1422
|
+
@derivative(of: erf, wrt: x)
|
|
1423
|
+
@inlinable internal func _jvpErf(_ x: Swift::Float) -> (value: Swift::Float, differential: (Swift::Float) -> Swift::Float) {
|
|
1424
|
+
return (erf(x), { v in v * Float(M_2_SQRTPI) * exp(-x * x) })
|
|
1425
|
+
}
|
|
1426
|
+
@derivative(of: erfc, wrt: x)
|
|
1427
|
+
@inlinable internal func _jvpErfc(_ x: Swift::Float) -> (value: Swift::Float, differential: (Swift::Float) -> Swift::Float) {
|
|
1428
|
+
return (erfc(x), { v in v * -Float(M_2_SQRTPI) * exp(-x * x) })
|
|
1429
|
+
}
|
|
1430
|
+
@derivative(of: exp, wrt: x)
|
|
1431
|
+
@inlinable internal func _jvpExp(_ x: Swift::Double) -> (value: Swift::Double, differential: (Swift::Double) -> Swift::Double) {
|
|
1432
|
+
let value = exp(x)
|
|
1433
|
+
return (value, { v in value * v })
|
|
1434
|
+
}
|
|
1435
|
+
@derivative(of: exp2, wrt: x)
|
|
1436
|
+
@inlinable internal func _jvpExp2(_ x: Swift::Double) -> (value: Swift::Double, differential: (Swift::Double) -> Swift::Double) {
|
|
1437
|
+
let value = exp2(x)
|
|
1438
|
+
return (value, { v in v * Double(M_LN2) * value })
|
|
1439
|
+
}
|
|
1440
|
+
@derivative(of: log, wrt: x)
|
|
1441
|
+
@inlinable internal func _jvpLog(_ x: Swift::Double) -> (value: Swift::Double, differential: (Swift::Double) -> Swift::Double) {
|
|
1442
|
+
return (log(x), { v in v / x })
|
|
1443
|
+
}
|
|
1444
|
+
@derivative(of: log10, wrt: x)
|
|
1445
|
+
@inlinable internal func _jvpLog10(_ x: Swift::Double) -> (value: Swift::Double, differential: (Swift::Double) -> Swift::Double) {
|
|
1446
|
+
return (log10(x), { v in v * Double(M_LOG10E) / x })
|
|
1447
|
+
}
|
|
1448
|
+
@derivative(of: log2, wrt: x)
|
|
1449
|
+
@inlinable internal func _jvpLog2(_ x: Swift::Double) -> (value: Swift::Double, differential: (Swift::Double) -> Swift::Double) {
|
|
1450
|
+
return (log2(x), { v in v / (Double(M_LN2) * x) })
|
|
1451
|
+
}
|
|
1452
|
+
@derivative(of: sin, wrt: x)
|
|
1453
|
+
@inlinable internal func _jvpSin(_ x: Swift::Double) -> (value: Swift::Double, differential: (Swift::Double) -> Swift::Double) {
|
|
1454
|
+
return (sin(x), { v in v * cos(x) })
|
|
1455
|
+
}
|
|
1456
|
+
@derivative(of: cos, wrt: x)
|
|
1457
|
+
@inlinable internal func _jvpCos(_ x: Swift::Double) -> (value: Swift::Double, differential: (Swift::Double) -> Swift::Double) {
|
|
1458
|
+
return (cos(x), { v in -v * sin(x) })
|
|
1459
|
+
}
|
|
1460
|
+
@derivative(of: tan, wrt: x)
|
|
1461
|
+
@inlinable internal func _jvpTan(_ x: Swift::Double) -> (value: Swift::Double, differential: (Swift::Double) -> Swift::Double) {
|
|
1462
|
+
let value = tan(x)
|
|
1463
|
+
return (value, { v in v * (1 + value * value) })
|
|
1464
|
+
}
|
|
1465
|
+
@derivative(of: asin, wrt: x)
|
|
1466
|
+
@inlinable internal func _jvpAsin(_ x: Swift::Double) -> (value: Swift::Double, differential: (Swift::Double) -> Swift::Double) {
|
|
1467
|
+
return (asin(x), { v in v / sqrt(1 - x * x) })
|
|
1468
|
+
}
|
|
1469
|
+
@derivative(of: acos, wrt: x)
|
|
1470
|
+
@inlinable internal func _jvpAcos(_ x: Swift::Double) -> (value: Swift::Double, differential: (Swift::Double) -> Swift::Double) {
|
|
1471
|
+
return (acos(x), { v in -v / sqrt(1 - x * x) })
|
|
1472
|
+
}
|
|
1473
|
+
@derivative(of: atan, wrt: x)
|
|
1474
|
+
@inlinable internal func _jvpAtan(_ x: Swift::Double) -> (value: Swift::Double, differential: (Swift::Double) -> Swift::Double) {
|
|
1475
|
+
return (atan(x), { v in v / (1 + x * x) })
|
|
1476
|
+
}
|
|
1477
|
+
@derivative(of: sinh, wrt: x)
|
|
1478
|
+
@inlinable internal func _jvpSinh(_ x: Swift::Double) -> (value: Swift::Double, differential: (Swift::Double) -> Swift::Double) {
|
|
1479
|
+
return (sinh(x), { v in v * cosh(x) })
|
|
1480
|
+
}
|
|
1481
|
+
@derivative(of: cosh, wrt: x)
|
|
1482
|
+
@inlinable internal func _jvpCosh(_ x: Swift::Double) -> (value: Swift::Double, differential: (Swift::Double) -> Swift::Double) {
|
|
1483
|
+
return (cosh(x), { v in v * sinh(x) })
|
|
1484
|
+
}
|
|
1485
|
+
@derivative(of: tanh, wrt: x)
|
|
1486
|
+
@inlinable internal func _jvpTanh(_ x: Swift::Double) -> (value: Swift::Double, differential: (Swift::Double) -> Swift::Double) {
|
|
1487
|
+
let value = tanh(x)
|
|
1488
|
+
return (value, { v in v * (1 - value * value) })
|
|
1489
|
+
}
|
|
1490
|
+
@derivative(of: asinh, wrt: x)
|
|
1491
|
+
@inlinable internal func _jvpAsinh(_ x: Swift::Double) -> (value: Swift::Double, differential: (Swift::Double) -> Swift::Double) {
|
|
1492
|
+
return (asinh(x), { v in v / sqrt(1 + x * x) })
|
|
1493
|
+
}
|
|
1494
|
+
@derivative(of: acosh, wrt: x)
|
|
1495
|
+
@inlinable internal func _jvpAcosh(_ x: Swift::Double) -> (value: Swift::Double, differential: (Swift::Double) -> Swift::Double) {
|
|
1496
|
+
return (acosh(x), { v in v / sqrt(x * x - 1) })
|
|
1497
|
+
}
|
|
1498
|
+
@derivative(of: atanh, wrt: x)
|
|
1499
|
+
@inlinable internal func _jvpAtanh(_ x: Swift::Double) -> (value: Swift::Double, differential: (Swift::Double) -> Swift::Double) {
|
|
1500
|
+
return (atanh(x), { v in v / (1 - x * x) })
|
|
1501
|
+
}
|
|
1502
|
+
@derivative(of: expm1, wrt: x)
|
|
1503
|
+
@inlinable internal func _jvpExpm1(_ x: Swift::Double) -> (value: Swift::Double, differential: (Swift::Double) -> Swift::Double) {
|
|
1504
|
+
return (expm1(x), { v in exp(x) * v })
|
|
1505
|
+
}
|
|
1506
|
+
@derivative(of: log1p, wrt: x)
|
|
1507
|
+
@inlinable internal func _jvpLog1p(_ x: Swift::Double) -> (value: Swift::Double, differential: (Swift::Double) -> Swift::Double) {
|
|
1508
|
+
return (log1p(x), { v in v / (x + 1) })
|
|
1509
|
+
}
|
|
1510
|
+
@derivative(of: erf, wrt: x)
|
|
1511
|
+
@inlinable internal func _jvpErf(_ x: Swift::Double) -> (value: Swift::Double, differential: (Swift::Double) -> Swift::Double) {
|
|
1512
|
+
return (erf(x), { v in v * Double(M_2_SQRTPI) * exp(-x * x) })
|
|
1513
|
+
}
|
|
1514
|
+
@derivative(of: erfc, wrt: x)
|
|
1515
|
+
@inlinable internal func _jvpErfc(_ x: Swift::Double) -> (value: Swift::Double, differential: (Swift::Double) -> Swift::Double) {
|
|
1516
|
+
return (erfc(x), { v in v * -Double(M_2_SQRTPI) * exp(-x * x) })
|
|
1517
|
+
}
|
|
1518
|
+
@derivative(of: exp, wrt: x)
|
|
1519
|
+
@inlinable internal func _vjpExp(_ x: Swift::Float) -> (value: Swift::Float, pullback: (Swift::Float) -> Swift::Float) {
|
|
1520
|
+
let value = exp(x)
|
|
1521
|
+
return (value, { v in value * v })
|
|
1522
|
+
}
|
|
1523
|
+
@derivative(of: exp2, wrt: x)
|
|
1524
|
+
@inlinable internal func _vjpExp2(_ x: Swift::Float) -> (value: Swift::Float, pullback: (Swift::Float) -> Swift::Float) {
|
|
1525
|
+
let value = exp2(x)
|
|
1526
|
+
return (value, { v in v * Float(M_LN2) * value })
|
|
1527
|
+
}
|
|
1528
|
+
@derivative(of: log, wrt: x)
|
|
1529
|
+
@inlinable internal func _vjpLog(_ x: Swift::Float) -> (value: Swift::Float, pullback: (Swift::Float) -> Swift::Float) {
|
|
1530
|
+
return (log(x), { v in v / x })
|
|
1531
|
+
}
|
|
1532
|
+
@derivative(of: log10, wrt: x)
|
|
1533
|
+
@inlinable internal func _vjpLog10(_ x: Swift::Float) -> (value: Swift::Float, pullback: (Swift::Float) -> Swift::Float) {
|
|
1534
|
+
return (log10(x), { v in v * Float(M_LOG10E) / x })
|
|
1535
|
+
}
|
|
1536
|
+
@derivative(of: log2, wrt: x)
|
|
1537
|
+
@inlinable internal func _vjpLog2(_ x: Swift::Float) -> (value: Swift::Float, pullback: (Swift::Float) -> Swift::Float) {
|
|
1538
|
+
return (log2(x), { v in v / (Float(M_LN2) * x) })
|
|
1539
|
+
}
|
|
1540
|
+
@derivative(of: sin, wrt: x)
|
|
1541
|
+
@inlinable internal func _vjpSin(_ x: Swift::Float) -> (value: Swift::Float, pullback: (Swift::Float) -> Swift::Float) {
|
|
1542
|
+
return (sin(x), { v in v * cos(x) })
|
|
1543
|
+
}
|
|
1544
|
+
@derivative(of: cos, wrt: x)
|
|
1545
|
+
@inlinable internal func _vjpCos(_ x: Swift::Float) -> (value: Swift::Float, pullback: (Swift::Float) -> Swift::Float) {
|
|
1546
|
+
return (cos(x), { v in -v * sin(x) })
|
|
1547
|
+
}
|
|
1548
|
+
@derivative(of: tan, wrt: x)
|
|
1549
|
+
@inlinable internal func _vjpTan(_ x: Swift::Float) -> (value: Swift::Float, pullback: (Swift::Float) -> Swift::Float) {
|
|
1550
|
+
let value = tan(x)
|
|
1551
|
+
return (value, { v in v * (1 + value * value) })
|
|
1552
|
+
}
|
|
1553
|
+
@derivative(of: asin, wrt: x)
|
|
1554
|
+
@inlinable internal func _vjpAsin(_ x: Swift::Float) -> (value: Swift::Float, pullback: (Swift::Float) -> Swift::Float) {
|
|
1555
|
+
return (asin(x), { v in v / sqrt(1 - x * x) })
|
|
1556
|
+
}
|
|
1557
|
+
@derivative(of: acos, wrt: x)
|
|
1558
|
+
@inlinable internal func _vjpAcos(_ x: Swift::Float) -> (value: Swift::Float, pullback: (Swift::Float) -> Swift::Float) {
|
|
1559
|
+
return (acos(x), { v in -v / sqrt(1 - x * x) })
|
|
1560
|
+
}
|
|
1561
|
+
@derivative(of: atan, wrt: x)
|
|
1562
|
+
@inlinable internal func _vjpAtan(_ x: Swift::Float) -> (value: Swift::Float, pullback: (Swift::Float) -> Swift::Float) {
|
|
1563
|
+
return (atan(x), { v in v / (1 + x * x) })
|
|
1564
|
+
}
|
|
1565
|
+
@derivative(of: sinh, wrt: x)
|
|
1566
|
+
@inlinable internal func _vjpSinh(_ x: Swift::Float) -> (value: Swift::Float, pullback: (Swift::Float) -> Swift::Float) {
|
|
1567
|
+
return (sinh(x), { v in v * cosh(x) })
|
|
1568
|
+
}
|
|
1569
|
+
@derivative(of: cosh, wrt: x)
|
|
1570
|
+
@inlinable internal func _vjpCosh(_ x: Swift::Float) -> (value: Swift::Float, pullback: (Swift::Float) -> Swift::Float) {
|
|
1571
|
+
return (cosh(x), { v in v * sinh(x) })
|
|
1572
|
+
}
|
|
1573
|
+
@derivative(of: tanh, wrt: x)
|
|
1574
|
+
@inlinable internal func _vjpTanh(_ x: Swift::Float) -> (value: Swift::Float, pullback: (Swift::Float) -> Swift::Float) {
|
|
1575
|
+
let value = tanh(x)
|
|
1576
|
+
return (value, { v in v * (1 - value * value) })
|
|
1577
|
+
}
|
|
1578
|
+
@derivative(of: asinh, wrt: x)
|
|
1579
|
+
@inlinable internal func _vjpAsinh(_ x: Swift::Float) -> (value: Swift::Float, pullback: (Swift::Float) -> Swift::Float) {
|
|
1580
|
+
return (asinh(x), { v in v / sqrt(1 + x * x) })
|
|
1581
|
+
}
|
|
1582
|
+
@derivative(of: acosh, wrt: x)
|
|
1583
|
+
@inlinable internal func _vjpAcosh(_ x: Swift::Float) -> (value: Swift::Float, pullback: (Swift::Float) -> Swift::Float) {
|
|
1584
|
+
return (acosh(x), { v in v / sqrt(x * x - 1) })
|
|
1585
|
+
}
|
|
1586
|
+
@derivative(of: atanh, wrt: x)
|
|
1587
|
+
@inlinable internal func _vjpAtanh(_ x: Swift::Float) -> (value: Swift::Float, pullback: (Swift::Float) -> Swift::Float) {
|
|
1588
|
+
return (atanh(x), { v in v / (1 - x * x) })
|
|
1589
|
+
}
|
|
1590
|
+
@derivative(of: expm1, wrt: x)
|
|
1591
|
+
@inlinable internal func _vjpExpm1(_ x: Swift::Float) -> (value: Swift::Float, pullback: (Swift::Float) -> Swift::Float) {
|
|
1592
|
+
return (expm1(x), { v in exp(x) * v })
|
|
1593
|
+
}
|
|
1594
|
+
@derivative(of: log1p, wrt: x)
|
|
1595
|
+
@inlinable internal func _vjpLog1p(_ x: Swift::Float) -> (value: Swift::Float, pullback: (Swift::Float) -> Swift::Float) {
|
|
1596
|
+
return (log1p(x), { v in v / (x + 1) })
|
|
1597
|
+
}
|
|
1598
|
+
@derivative(of: erf, wrt: x)
|
|
1599
|
+
@inlinable internal func _vjpErf(_ x: Swift::Float) -> (value: Swift::Float, pullback: (Swift::Float) -> Swift::Float) {
|
|
1600
|
+
return (erf(x), { v in v * Float(M_2_SQRTPI) * exp(-x * x) })
|
|
1601
|
+
}
|
|
1602
|
+
@derivative(of: erfc, wrt: x)
|
|
1603
|
+
@inlinable internal func _vjpErfc(_ x: Swift::Float) -> (value: Swift::Float, pullback: (Swift::Float) -> Swift::Float) {
|
|
1604
|
+
return (erfc(x), { v in v * -Float(M_2_SQRTPI) * exp(-x * x) })
|
|
1605
|
+
}
|
|
1606
|
+
@derivative(of: exp, wrt: x)
|
|
1607
|
+
@inlinable internal func _vjpExp(_ x: Swift::Double) -> (value: Swift::Double, pullback: (Swift::Double) -> Swift::Double) {
|
|
1608
|
+
let value = exp(x)
|
|
1609
|
+
return (value, { v in value * v })
|
|
1610
|
+
}
|
|
1611
|
+
@derivative(of: exp2, wrt: x)
|
|
1612
|
+
@inlinable internal func _vjpExp2(_ x: Swift::Double) -> (value: Swift::Double, pullback: (Swift::Double) -> Swift::Double) {
|
|
1613
|
+
let value = exp2(x)
|
|
1614
|
+
return (value, { v in v * Double(M_LN2) * value })
|
|
1615
|
+
}
|
|
1616
|
+
@derivative(of: log, wrt: x)
|
|
1617
|
+
@inlinable internal func _vjpLog(_ x: Swift::Double) -> (value: Swift::Double, pullback: (Swift::Double) -> Swift::Double) {
|
|
1618
|
+
return (log(x), { v in v / x })
|
|
1619
|
+
}
|
|
1620
|
+
@derivative(of: log10, wrt: x)
|
|
1621
|
+
@inlinable internal func _vjpLog10(_ x: Swift::Double) -> (value: Swift::Double, pullback: (Swift::Double) -> Swift::Double) {
|
|
1622
|
+
return (log10(x), { v in v * Double(M_LOG10E) / x })
|
|
1623
|
+
}
|
|
1624
|
+
@derivative(of: log2, wrt: x)
|
|
1625
|
+
@inlinable internal func _vjpLog2(_ x: Swift::Double) -> (value: Swift::Double, pullback: (Swift::Double) -> Swift::Double) {
|
|
1626
|
+
return (log2(x), { v in v / (Double(M_LN2) * x) })
|
|
1627
|
+
}
|
|
1628
|
+
@derivative(of: sin, wrt: x)
|
|
1629
|
+
@inlinable internal func _vjpSin(_ x: Swift::Double) -> (value: Swift::Double, pullback: (Swift::Double) -> Swift::Double) {
|
|
1630
|
+
return (sin(x), { v in v * cos(x) })
|
|
1631
|
+
}
|
|
1632
|
+
@derivative(of: cos, wrt: x)
|
|
1633
|
+
@inlinable internal func _vjpCos(_ x: Swift::Double) -> (value: Swift::Double, pullback: (Swift::Double) -> Swift::Double) {
|
|
1634
|
+
return (cos(x), { v in -v * sin(x) })
|
|
1635
|
+
}
|
|
1636
|
+
@derivative(of: tan, wrt: x)
|
|
1637
|
+
@inlinable internal func _vjpTan(_ x: Swift::Double) -> (value: Swift::Double, pullback: (Swift::Double) -> Swift::Double) {
|
|
1638
|
+
let value = tan(x)
|
|
1639
|
+
return (value, { v in v * (1 + value * value) })
|
|
1640
|
+
}
|
|
1641
|
+
@derivative(of: asin, wrt: x)
|
|
1642
|
+
@inlinable internal func _vjpAsin(_ x: Swift::Double) -> (value: Swift::Double, pullback: (Swift::Double) -> Swift::Double) {
|
|
1643
|
+
return (asin(x), { v in v / sqrt(1 - x * x) })
|
|
1644
|
+
}
|
|
1645
|
+
@derivative(of: acos, wrt: x)
|
|
1646
|
+
@inlinable internal func _vjpAcos(_ x: Swift::Double) -> (value: Swift::Double, pullback: (Swift::Double) -> Swift::Double) {
|
|
1647
|
+
return (acos(x), { v in -v / sqrt(1 - x * x) })
|
|
1648
|
+
}
|
|
1649
|
+
@derivative(of: atan, wrt: x)
|
|
1650
|
+
@inlinable internal func _vjpAtan(_ x: Swift::Double) -> (value: Swift::Double, pullback: (Swift::Double) -> Swift::Double) {
|
|
1651
|
+
return (atan(x), { v in v / (1 + x * x) })
|
|
1652
|
+
}
|
|
1653
|
+
@derivative(of: sinh, wrt: x)
|
|
1654
|
+
@inlinable internal func _vjpSinh(_ x: Swift::Double) -> (value: Swift::Double, pullback: (Swift::Double) -> Swift::Double) {
|
|
1655
|
+
return (sinh(x), { v in v * cosh(x) })
|
|
1656
|
+
}
|
|
1657
|
+
@derivative(of: cosh, wrt: x)
|
|
1658
|
+
@inlinable internal func _vjpCosh(_ x: Swift::Double) -> (value: Swift::Double, pullback: (Swift::Double) -> Swift::Double) {
|
|
1659
|
+
return (cosh(x), { v in v * sinh(x) })
|
|
1660
|
+
}
|
|
1661
|
+
@derivative(of: tanh, wrt: x)
|
|
1662
|
+
@inlinable internal func _vjpTanh(_ x: Swift::Double) -> (value: Swift::Double, pullback: (Swift::Double) -> Swift::Double) {
|
|
1663
|
+
let value = tanh(x)
|
|
1664
|
+
return (value, { v in v * (1 - value * value) })
|
|
1665
|
+
}
|
|
1666
|
+
@derivative(of: asinh, wrt: x)
|
|
1667
|
+
@inlinable internal func _vjpAsinh(_ x: Swift::Double) -> (value: Swift::Double, pullback: (Swift::Double) -> Swift::Double) {
|
|
1668
|
+
return (asinh(x), { v in v / sqrt(1 + x * x) })
|
|
1669
|
+
}
|
|
1670
|
+
@derivative(of: acosh, wrt: x)
|
|
1671
|
+
@inlinable internal func _vjpAcosh(_ x: Swift::Double) -> (value: Swift::Double, pullback: (Swift::Double) -> Swift::Double) {
|
|
1672
|
+
return (acosh(x), { v in v / sqrt(x * x - 1) })
|
|
1673
|
+
}
|
|
1674
|
+
@derivative(of: atanh, wrt: x)
|
|
1675
|
+
@inlinable internal func _vjpAtanh(_ x: Swift::Double) -> (value: Swift::Double, pullback: (Swift::Double) -> Swift::Double) {
|
|
1676
|
+
return (atanh(x), { v in v / (1 - x * x) })
|
|
1677
|
+
}
|
|
1678
|
+
@derivative(of: expm1, wrt: x)
|
|
1679
|
+
@inlinable internal func _vjpExpm1(_ x: Swift::Double) -> (value: Swift::Double, pullback: (Swift::Double) -> Swift::Double) {
|
|
1680
|
+
return (expm1(x), { v in exp(x) * v })
|
|
1681
|
+
}
|
|
1682
|
+
@derivative(of: log1p, wrt: x)
|
|
1683
|
+
@inlinable internal func _vjpLog1p(_ x: Swift::Double) -> (value: Swift::Double, pullback: (Swift::Double) -> Swift::Double) {
|
|
1684
|
+
return (log1p(x), { v in v / (x + 1) })
|
|
1685
|
+
}
|
|
1686
|
+
@derivative(of: erf, wrt: x)
|
|
1687
|
+
@inlinable internal func _vjpErf(_ x: Swift::Double) -> (value: Swift::Double, pullback: (Swift::Double) -> Swift::Double) {
|
|
1688
|
+
return (erf(x), { v in v * Double(M_2_SQRTPI) * exp(-x * x) })
|
|
1689
|
+
}
|
|
1690
|
+
@derivative(of: erfc, wrt: x)
|
|
1691
|
+
@inlinable internal func _vjpErfc(_ x: Swift::Double) -> (value: Swift::Double, pullback: (Swift::Double) -> Swift::Double) {
|
|
1692
|
+
return (erfc(x), { v in v * -Double(M_2_SQRTPI) * exp(-x * x) })
|
|
1693
|
+
}
|
|
1694
|
+
@derivative(of: pow, wrt: (x, y))
|
|
1695
|
+
@inlinable internal func _vjpPow(_ x: Swift::Float, _ y: Swift::Float) -> (value: Swift::Float, pullback: (Swift::Float) -> (Swift::Float, Swift::Float)) {
|
|
1696
|
+
let value = pow(x, y)
|
|
1697
|
+
return (value, { v in (
|
|
1698
|
+
v * y * pow(x, y - 1), v * value * log(x.isLessThanOrEqualTo(0) ? Float(1) : x)
|
|
1699
|
+
) })
|
|
1700
|
+
}
|
|
1701
|
+
@derivative(of: pow, wrt: (x, y))
|
|
1702
|
+
@inlinable internal func _jvpPow(_ x: Swift::Float, _ y: Swift::Float) -> (value: Swift::Float, differential: (Swift::Float, Swift::Float) -> Swift::Float) {
|
|
1703
|
+
let value = pow(x, y)
|
|
1704
|
+
return (value, { (dx, dy) in
|
|
1705
|
+
dx * y * pow(x, y - 1) + dy * value * log(x.isLessThanOrEqualTo(0) ? Float(1) : x)
|
|
1706
|
+
})
|
|
1707
|
+
}
|
|
1708
|
+
@derivative(of: pow, wrt: (x, y))
|
|
1709
|
+
@inlinable internal func _vjpPow(_ x: Swift::Double, _ y: Swift::Double) -> (value: Swift::Double, pullback: (Swift::Double) -> (Swift::Double, Swift::Double)) {
|
|
1710
|
+
let value = pow(x, y)
|
|
1711
|
+
return (value, { v in (
|
|
1712
|
+
v * y * pow(x, y - 1), v * value * log(x.isLessThanOrEqualTo(0) ? Double(1) : x)
|
|
1713
|
+
) })
|
|
1714
|
+
}
|
|
1715
|
+
@derivative(of: pow, wrt: (x, y))
|
|
1716
|
+
@inlinable internal func _jvpPow(_ x: Swift::Double, _ y: Swift::Double) -> (value: Swift::Double, differential: (Swift::Double, Swift::Double) -> Swift::Double) {
|
|
1717
|
+
let value = pow(x, y)
|
|
1718
|
+
return (value, { (dx, dy) in
|
|
1719
|
+
dx * y * pow(x, y - 1) + dy * value * log(x.isLessThanOrEqualTo(0) ? Double(1) : x)
|
|
1720
|
+
})
|
|
1721
|
+
}
|
|
1722
|
+
extension Swift::SIMD2 : @retroactive Swift::AdditiveArithmetic where Scalar : Swift::FloatingPoint {
|
|
1723
|
+
}
|
|
1724
|
+
extension Swift::SIMD2 : _Differentiation::Differentiable where Scalar : Swift::BinaryFloatingPoint, Scalar : _Differentiation::Differentiable, Scalar.TangentVector : Swift::BinaryFloatingPoint {
|
|
1725
|
+
public typealias TangentVector = Swift::SIMD2<Scalar>
|
|
1726
|
+
}
|
|
1727
|
+
extension Swift::SIMD2 where Scalar : Swift::BinaryFloatingPoint, Scalar : _Differentiation::Differentiable, Scalar == Scalar.TangentVector {
|
|
1728
|
+
@derivative(of: subscript(_:), wrt: self)
|
|
1729
|
+
@inlinable internal func _vjpSubscript(_ index: Swift::Int) -> (value: Scalar, pullback: (Scalar.TangentVector) -> Swift::SIMD2<Scalar>._Differentiation::TangentVector) {
|
|
1730
|
+
return (self[index], { v in
|
|
1731
|
+
var zeros = Self.zero
|
|
1732
|
+
zeros[index] = v
|
|
1733
|
+
return zeros
|
|
1734
|
+
})
|
|
1735
|
+
}
|
|
1736
|
+
@derivative(of: subscript(_:), wrt: self)
|
|
1737
|
+
@inlinable internal func _jvpSubscript(index: Swift::Int) -> (value: Scalar, differential: (Swift::SIMD2<Scalar>._Differentiation::TangentVector) -> Scalar.TangentVector) {
|
|
1738
|
+
return (self[index], { v in
|
|
1739
|
+
return .init(v[index])
|
|
1740
|
+
})
|
|
1741
|
+
}
|
|
1742
|
+
@derivative(of: subscript(_:).set, wrt: (self, newValue))
|
|
1743
|
+
@inlinable internal mutating func _vjpSubscriptSetter(_ newValue: Scalar, _ index: Swift::Int) -> (value: Swift::Void, pullback: (inout Swift::SIMD2<Scalar>._Differentiation::TangentVector) -> Scalar.TangentVector) {
|
|
1744
|
+
self[index] = newValue
|
|
1745
|
+
return ((), { dSelf in
|
|
1746
|
+
let dNewValue = dSelf[index]
|
|
1747
|
+
dSelf[index] = 0
|
|
1748
|
+
return dNewValue
|
|
1749
|
+
})
|
|
1750
|
+
}
|
|
1751
|
+
}
|
|
1752
|
+
extension Swift::SIMD4 : @retroactive Swift::AdditiveArithmetic where Scalar : Swift::FloatingPoint {
|
|
1753
|
+
}
|
|
1754
|
+
extension Swift::SIMD4 : _Differentiation::Differentiable where Scalar : Swift::BinaryFloatingPoint, Scalar : _Differentiation::Differentiable, Scalar.TangentVector : Swift::BinaryFloatingPoint {
|
|
1755
|
+
public typealias TangentVector = Swift::SIMD4<Scalar>
|
|
1756
|
+
}
|
|
1757
|
+
extension Swift::SIMD4 where Scalar : Swift::BinaryFloatingPoint, Scalar : _Differentiation::Differentiable, Scalar == Scalar.TangentVector {
|
|
1758
|
+
@derivative(of: subscript(_:), wrt: self)
|
|
1759
|
+
@inlinable internal func _vjpSubscript(_ index: Swift::Int) -> (value: Scalar, pullback: (Scalar.TangentVector) -> Swift::SIMD4<Scalar>._Differentiation::TangentVector) {
|
|
1760
|
+
return (self[index], { v in
|
|
1761
|
+
var zeros = Self.zero
|
|
1762
|
+
zeros[index] = v
|
|
1763
|
+
return zeros
|
|
1764
|
+
})
|
|
1765
|
+
}
|
|
1766
|
+
@derivative(of: subscript(_:), wrt: self)
|
|
1767
|
+
@inlinable internal func _jvpSubscript(index: Swift::Int) -> (value: Scalar, differential: (Swift::SIMD4<Scalar>._Differentiation::TangentVector) -> Scalar.TangentVector) {
|
|
1768
|
+
return (self[index], { v in
|
|
1769
|
+
return .init(v[index])
|
|
1770
|
+
})
|
|
1771
|
+
}
|
|
1772
|
+
@derivative(of: subscript(_:).set, wrt: (self, newValue))
|
|
1773
|
+
@inlinable internal mutating func _vjpSubscriptSetter(_ newValue: Scalar, _ index: Swift::Int) -> (value: Swift::Void, pullback: (inout Swift::SIMD4<Scalar>._Differentiation::TangentVector) -> Scalar.TangentVector) {
|
|
1774
|
+
self[index] = newValue
|
|
1775
|
+
return ((), { dSelf in
|
|
1776
|
+
let dNewValue = dSelf[index]
|
|
1777
|
+
dSelf[index] = 0
|
|
1778
|
+
return dNewValue
|
|
1779
|
+
})
|
|
1780
|
+
}
|
|
1781
|
+
}
|
|
1782
|
+
extension Swift::SIMD8 : @retroactive Swift::AdditiveArithmetic where Scalar : Swift::FloatingPoint {
|
|
1783
|
+
}
|
|
1784
|
+
extension Swift::SIMD8 : _Differentiation::Differentiable where Scalar : Swift::BinaryFloatingPoint, Scalar : _Differentiation::Differentiable, Scalar.TangentVector : Swift::BinaryFloatingPoint {
|
|
1785
|
+
public typealias TangentVector = Swift::SIMD8<Scalar>
|
|
1786
|
+
}
|
|
1787
|
+
extension Swift::SIMD8 where Scalar : Swift::BinaryFloatingPoint, Scalar : _Differentiation::Differentiable, Scalar == Scalar.TangentVector {
|
|
1788
|
+
@derivative(of: subscript(_:), wrt: self)
|
|
1789
|
+
@inlinable internal func _vjpSubscript(_ index: Swift::Int) -> (value: Scalar, pullback: (Scalar.TangentVector) -> Swift::SIMD8<Scalar>._Differentiation::TangentVector) {
|
|
1790
|
+
return (self[index], { v in
|
|
1791
|
+
var zeros = Self.zero
|
|
1792
|
+
zeros[index] = v
|
|
1793
|
+
return zeros
|
|
1794
|
+
})
|
|
1795
|
+
}
|
|
1796
|
+
@derivative(of: subscript(_:), wrt: self)
|
|
1797
|
+
@inlinable internal func _jvpSubscript(index: Swift::Int) -> (value: Scalar, differential: (Swift::SIMD8<Scalar>._Differentiation::TangentVector) -> Scalar.TangentVector) {
|
|
1798
|
+
return (self[index], { v in
|
|
1799
|
+
return .init(v[index])
|
|
1800
|
+
})
|
|
1801
|
+
}
|
|
1802
|
+
@derivative(of: subscript(_:).set, wrt: (self, newValue))
|
|
1803
|
+
@inlinable internal mutating func _vjpSubscriptSetter(_ newValue: Scalar, _ index: Swift::Int) -> (value: Swift::Void, pullback: (inout Swift::SIMD8<Scalar>._Differentiation::TangentVector) -> Scalar.TangentVector) {
|
|
1804
|
+
self[index] = newValue
|
|
1805
|
+
return ((), { dSelf in
|
|
1806
|
+
let dNewValue = dSelf[index]
|
|
1807
|
+
dSelf[index] = 0
|
|
1808
|
+
return dNewValue
|
|
1809
|
+
})
|
|
1810
|
+
}
|
|
1811
|
+
}
|
|
1812
|
+
extension Swift::SIMD16 : @retroactive Swift::AdditiveArithmetic where Scalar : Swift::FloatingPoint {
|
|
1813
|
+
}
|
|
1814
|
+
extension Swift::SIMD16 : _Differentiation::Differentiable where Scalar : Swift::BinaryFloatingPoint, Scalar : _Differentiation::Differentiable, Scalar.TangentVector : Swift::BinaryFloatingPoint {
|
|
1815
|
+
public typealias TangentVector = Swift::SIMD16<Scalar>
|
|
1816
|
+
}
|
|
1817
|
+
extension Swift::SIMD16 where Scalar : Swift::BinaryFloatingPoint, Scalar : _Differentiation::Differentiable, Scalar == Scalar.TangentVector {
|
|
1818
|
+
@derivative(of: subscript(_:), wrt: self)
|
|
1819
|
+
@inlinable internal func _vjpSubscript(_ index: Swift::Int) -> (value: Scalar, pullback: (Scalar.TangentVector) -> Swift::SIMD16<Scalar>._Differentiation::TangentVector) {
|
|
1820
|
+
return (self[index], { v in
|
|
1821
|
+
var zeros = Self.zero
|
|
1822
|
+
zeros[index] = v
|
|
1823
|
+
return zeros
|
|
1824
|
+
})
|
|
1825
|
+
}
|
|
1826
|
+
@derivative(of: subscript(_:), wrt: self)
|
|
1827
|
+
@inlinable internal func _jvpSubscript(index: Swift::Int) -> (value: Scalar, differential: (Swift::SIMD16<Scalar>._Differentiation::TangentVector) -> Scalar.TangentVector) {
|
|
1828
|
+
return (self[index], { v in
|
|
1829
|
+
return .init(v[index])
|
|
1830
|
+
})
|
|
1831
|
+
}
|
|
1832
|
+
@derivative(of: subscript(_:).set, wrt: (self, newValue))
|
|
1833
|
+
@inlinable internal mutating func _vjpSubscriptSetter(_ newValue: Scalar, _ index: Swift::Int) -> (value: Swift::Void, pullback: (inout Swift::SIMD16<Scalar>._Differentiation::TangentVector) -> Scalar.TangentVector) {
|
|
1834
|
+
self[index] = newValue
|
|
1835
|
+
return ((), { dSelf in
|
|
1836
|
+
let dNewValue = dSelf[index]
|
|
1837
|
+
dSelf[index] = 0
|
|
1838
|
+
return dNewValue
|
|
1839
|
+
})
|
|
1840
|
+
}
|
|
1841
|
+
}
|
|
1842
|
+
extension Swift::SIMD32 : @retroactive Swift::AdditiveArithmetic where Scalar : Swift::FloatingPoint {
|
|
1843
|
+
}
|
|
1844
|
+
extension Swift::SIMD32 : _Differentiation::Differentiable where Scalar : Swift::BinaryFloatingPoint, Scalar : _Differentiation::Differentiable, Scalar.TangentVector : Swift::BinaryFloatingPoint {
|
|
1845
|
+
public typealias TangentVector = Swift::SIMD32<Scalar>
|
|
1846
|
+
}
|
|
1847
|
+
extension Swift::SIMD32 where Scalar : Swift::BinaryFloatingPoint, Scalar : _Differentiation::Differentiable, Scalar == Scalar.TangentVector {
|
|
1848
|
+
@derivative(of: subscript(_:), wrt: self)
|
|
1849
|
+
@inlinable internal func _vjpSubscript(_ index: Swift::Int) -> (value: Scalar, pullback: (Scalar.TangentVector) -> Swift::SIMD32<Scalar>._Differentiation::TangentVector) {
|
|
1850
|
+
return (self[index], { v in
|
|
1851
|
+
var zeros = Self.zero
|
|
1852
|
+
zeros[index] = v
|
|
1853
|
+
return zeros
|
|
1854
|
+
})
|
|
1855
|
+
}
|
|
1856
|
+
@derivative(of: subscript(_:), wrt: self)
|
|
1857
|
+
@inlinable internal func _jvpSubscript(index: Swift::Int) -> (value: Scalar, differential: (Swift::SIMD32<Scalar>._Differentiation::TangentVector) -> Scalar.TangentVector) {
|
|
1858
|
+
return (self[index], { v in
|
|
1859
|
+
return .init(v[index])
|
|
1860
|
+
})
|
|
1861
|
+
}
|
|
1862
|
+
@derivative(of: subscript(_:).set, wrt: (self, newValue))
|
|
1863
|
+
@inlinable internal mutating func _vjpSubscriptSetter(_ newValue: Scalar, _ index: Swift::Int) -> (value: Swift::Void, pullback: (inout Swift::SIMD32<Scalar>._Differentiation::TangentVector) -> Scalar.TangentVector) {
|
|
1864
|
+
self[index] = newValue
|
|
1865
|
+
return ((), { dSelf in
|
|
1866
|
+
let dNewValue = dSelf[index]
|
|
1867
|
+
dSelf[index] = 0
|
|
1868
|
+
return dNewValue
|
|
1869
|
+
})
|
|
1870
|
+
}
|
|
1871
|
+
}
|
|
1872
|
+
extension Swift::SIMD64 : @retroactive Swift::AdditiveArithmetic where Scalar : Swift::FloatingPoint {
|
|
1873
|
+
}
|
|
1874
|
+
extension Swift::SIMD64 : _Differentiation::Differentiable where Scalar : Swift::BinaryFloatingPoint, Scalar : _Differentiation::Differentiable, Scalar.TangentVector : Swift::BinaryFloatingPoint {
|
|
1875
|
+
public typealias TangentVector = Swift::SIMD64<Scalar>
|
|
1876
|
+
}
|
|
1877
|
+
extension Swift::SIMD64 where Scalar : Swift::BinaryFloatingPoint, Scalar : _Differentiation::Differentiable, Scalar == Scalar.TangentVector {
|
|
1878
|
+
@derivative(of: subscript(_:), wrt: self)
|
|
1879
|
+
@inlinable internal func _vjpSubscript(_ index: Swift::Int) -> (value: Scalar, pullback: (Scalar.TangentVector) -> Swift::SIMD64<Scalar>._Differentiation::TangentVector) {
|
|
1880
|
+
return (self[index], { v in
|
|
1881
|
+
var zeros = Self.zero
|
|
1882
|
+
zeros[index] = v
|
|
1883
|
+
return zeros
|
|
1884
|
+
})
|
|
1885
|
+
}
|
|
1886
|
+
@derivative(of: subscript(_:), wrt: self)
|
|
1887
|
+
@inlinable internal func _jvpSubscript(index: Swift::Int) -> (value: Scalar, differential: (Swift::SIMD64<Scalar>._Differentiation::TangentVector) -> Scalar.TangentVector) {
|
|
1888
|
+
return (self[index], { v in
|
|
1889
|
+
return .init(v[index])
|
|
1890
|
+
})
|
|
1891
|
+
}
|
|
1892
|
+
@derivative(of: subscript(_:).set, wrt: (self, newValue))
|
|
1893
|
+
@inlinable internal mutating func _vjpSubscriptSetter(_ newValue: Scalar, _ index: Swift::Int) -> (value: Swift::Void, pullback: (inout Swift::SIMD64<Scalar>._Differentiation::TangentVector) -> Scalar.TangentVector) {
|
|
1894
|
+
self[index] = newValue
|
|
1895
|
+
return ((), { dSelf in
|
|
1896
|
+
let dNewValue = dSelf[index]
|
|
1897
|
+
dSelf[index] = 0
|
|
1898
|
+
return dNewValue
|
|
1899
|
+
})
|
|
1900
|
+
}
|
|
1901
|
+
}
|
|
1902
|
+
extension Swift::SIMD3 : @retroactive Swift::AdditiveArithmetic where Scalar : Swift::FloatingPoint {
|
|
1903
|
+
}
|
|
1904
|
+
extension Swift::SIMD3 : _Differentiation::Differentiable where Scalar : Swift::BinaryFloatingPoint, Scalar : _Differentiation::Differentiable, Scalar.TangentVector : Swift::BinaryFloatingPoint {
|
|
1905
|
+
public typealias TangentVector = Swift::SIMD3<Scalar>
|
|
1906
|
+
}
|
|
1907
|
+
extension Swift::SIMD3 where Scalar : Swift::BinaryFloatingPoint, Scalar : _Differentiation::Differentiable, Scalar == Scalar.TangentVector {
|
|
1908
|
+
@derivative(of: subscript(_:), wrt: self)
|
|
1909
|
+
@inlinable internal func _vjpSubscript(_ index: Swift::Int) -> (value: Scalar, pullback: (Scalar.TangentVector) -> Swift::SIMD3<Scalar>._Differentiation::TangentVector) {
|
|
1910
|
+
return (self[index], { v in
|
|
1911
|
+
var zeros = Self.zero
|
|
1912
|
+
zeros[index] = v
|
|
1913
|
+
return zeros
|
|
1914
|
+
})
|
|
1915
|
+
}
|
|
1916
|
+
@derivative(of: subscript(_:), wrt: self)
|
|
1917
|
+
@inlinable internal func _jvpSubscript(index: Swift::Int) -> (value: Scalar, differential: (Swift::SIMD3<Scalar>._Differentiation::TangentVector) -> Scalar.TangentVector) {
|
|
1918
|
+
return (self[index], { v in
|
|
1919
|
+
return .init(v[index])
|
|
1920
|
+
})
|
|
1921
|
+
}
|
|
1922
|
+
@derivative(of: subscript(_:).set, wrt: (self, newValue))
|
|
1923
|
+
@inlinable internal mutating func _vjpSubscriptSetter(_ newValue: Scalar, _ index: Swift::Int) -> (value: Swift::Void, pullback: (inout Swift::SIMD3<Scalar>._Differentiation::TangentVector) -> Scalar.TangentVector) {
|
|
1924
|
+
self[index] = newValue
|
|
1925
|
+
return ((), { dSelf in
|
|
1926
|
+
let dNewValue = dSelf[index]
|
|
1927
|
+
dSelf[index] = 0
|
|
1928
|
+
return dNewValue
|
|
1929
|
+
})
|
|
1930
|
+
}
|
|
1931
|
+
}
|
|
1932
|
+
extension Swift::SIMD where Self : _Differentiation::Differentiable, Self.Scalar : Swift::BinaryFloatingPoint, Self.TangentVector : Swift::SIMD, Self.TangentVector.Scalar : Swift::BinaryFloatingPoint {
|
|
1933
|
+
@derivative(of: +, wrt: (lhs, rhs))
|
|
1934
|
+
@inlinable internal static func _vjpAdd(lhs: Self, rhs: Self) -> (value: Self, pullback: (Self.TangentVector) -> (Self.TangentVector, Self.TangentVector)) {
|
|
1935
|
+
return (lhs + rhs, { v in
|
|
1936
|
+
return (v, v)
|
|
1937
|
+
})
|
|
1938
|
+
}
|
|
1939
|
+
@derivative(of: +, wrt: (lhs, rhs))
|
|
1940
|
+
@inlinable internal static func _jvpAdd(lhs: Self, rhs: Self) -> (value: Self, differential: (Self.TangentVector, Self.TangentVector) -> Self.TangentVector) {
|
|
1941
|
+
return (lhs + rhs, { ltan, rtan in
|
|
1942
|
+
return ltan + rtan
|
|
1943
|
+
})
|
|
1944
|
+
}
|
|
1945
|
+
@derivative(of: -, wrt: (lhs, rhs))
|
|
1946
|
+
@inlinable internal static func _vjpSubtract(lhs: Self, rhs: Self) -> (value: Self, pullback: (Self.TangentVector) -> (Self.TangentVector, Self.TangentVector)) {
|
|
1947
|
+
return (lhs - rhs, { v in
|
|
1948
|
+
return (v, -v)
|
|
1949
|
+
})
|
|
1950
|
+
}
|
|
1951
|
+
@derivative(of: -, wrt: (lhs, rhs))
|
|
1952
|
+
@inlinable internal static func _jvpSubtract(lhs: Self, rhs: Self) -> (value: Self, differential: (Self.TangentVector, Self.TangentVector) -> Self.TangentVector) {
|
|
1953
|
+
return (lhs - rhs, { ltan, rtan in
|
|
1954
|
+
return ltan - rtan
|
|
1955
|
+
})
|
|
1956
|
+
}
|
|
1957
|
+
@derivative(of: -, wrt: rhs)
|
|
1958
|
+
@inlinable internal static func _vjpNegate(rhs: Self) -> (value: Self, pullback: (Self.TangentVector) -> Self.TangentVector) {
|
|
1959
|
+
return (-rhs, { v in
|
|
1960
|
+
return -v
|
|
1961
|
+
})
|
|
1962
|
+
}
|
|
1963
|
+
@derivative(of: -, wrt: rhs)
|
|
1964
|
+
@inlinable internal static func _jvpNegate(rhs: Self) -> (value: Self, differential: (Self.TangentVector) -> Self.TangentVector) {
|
|
1965
|
+
return (-rhs, { v in
|
|
1966
|
+
return -v
|
|
1967
|
+
})
|
|
1968
|
+
}
|
|
1969
|
+
}
|
|
1970
|
+
extension Swift::SIMD where Self : _Differentiation::Differentiable, Self == Self.TangentVector, Self.Scalar : Swift::BinaryFloatingPoint {
|
|
1971
|
+
@derivative(of: *, wrt: (lhs, rhs))
|
|
1972
|
+
@inlinable internal static func _vjpMultiply(lhs: Self, rhs: Self) -> (value: Self, pullback: (Self.TangentVector) -> (Self.TangentVector, Self.TangentVector)) {
|
|
1973
|
+
return (lhs * rhs, { v in
|
|
1974
|
+
return (v * rhs, v * lhs)
|
|
1975
|
+
})
|
|
1976
|
+
}
|
|
1977
|
+
@derivative(of: *, wrt: (lhs, rhs))
|
|
1978
|
+
@inlinable internal static func _jvpMultiply(lhs: Self, rhs: Self) -> (value: Self, differential: (Self.TangentVector, Self.TangentVector) -> Self.TangentVector) {
|
|
1979
|
+
return (lhs * rhs, { ltan, rtan in
|
|
1980
|
+
return lhs * rtan + ltan * rhs
|
|
1981
|
+
})
|
|
1982
|
+
}
|
|
1983
|
+
@derivative(of: /, wrt: (lhs, rhs))
|
|
1984
|
+
@inlinable internal static func _vjpDivide(lhs: Self, rhs: Self) -> (value: Self, pullback: (Self.TangentVector) -> (Self.TangentVector, Self.TangentVector)) {
|
|
1985
|
+
return ( lhs / rhs, { v in
|
|
1986
|
+
(v / rhs, -lhs / (rhs * rhs) * v)
|
|
1987
|
+
})
|
|
1988
|
+
}
|
|
1989
|
+
@derivative(of: /, wrt: (lhs, rhs))
|
|
1990
|
+
@inlinable internal static func _jvpDivide(lhs: Self, rhs: Self) -> (value: Self, differential: (Self.TangentVector, Self.TangentVector) -> Self.TangentVector) {
|
|
1991
|
+
return ( lhs / rhs, { ltan, rtan in
|
|
1992
|
+
(ltan * rhs - lhs * rtan) / (rhs * rhs)
|
|
1993
|
+
})
|
|
1994
|
+
}
|
|
1995
|
+
}
|
|
1996
|
+
extension Swift::SIMD where Self : _Differentiation::Differentiable, Self.Scalar : Swift::BinaryFloatingPoint, Self.Scalar : _Differentiation::Differentiable, Self.TangentVector : Swift::SIMD, Self.Scalar.TangentVector : Swift::BinaryFloatingPoint, Self.Scalar.TangentVector == Self.TangentVector.Scalar {
|
|
1997
|
+
@derivative(of: +, wrt: (lhs, rhs))
|
|
1998
|
+
@inlinable internal static func _vjpAdd(lhs: Self.Scalar, rhs: Self) -> (value: Self, pullback: (Self.TangentVector) -> (Self.Scalar.TangentVector, Self.TangentVector)) {
|
|
1999
|
+
return (lhs + rhs, { v in
|
|
2000
|
+
return (v.sum(), v)
|
|
2001
|
+
})
|
|
2002
|
+
}
|
|
2003
|
+
@derivative(of: +, wrt: (lhs, rhs))
|
|
2004
|
+
@inlinable internal static func _jvpAdd(lhs: Self.Scalar, rhs: Self) -> (value: Self, differential: (Self.Scalar.TangentVector, Self.TangentVector) -> Self.TangentVector) {
|
|
2005
|
+
return (lhs + rhs, { ltan, rtan in
|
|
2006
|
+
return ltan + rtan
|
|
2007
|
+
})
|
|
2008
|
+
}
|
|
2009
|
+
@derivative(of: -, wrt: (lhs, rhs))
|
|
2010
|
+
@inlinable internal static func _vjpSubtract(lhs: Self.Scalar, rhs: Self) -> (value: Self, pullback: (Self.TangentVector) -> (Self.Scalar.TangentVector, Self.TangentVector)) {
|
|
2011
|
+
return (lhs - rhs, { v in
|
|
2012
|
+
return (v.sum(), -v)
|
|
2013
|
+
})
|
|
2014
|
+
}
|
|
2015
|
+
@derivative(of: -, wrt: (lhs, rhs))
|
|
2016
|
+
@inlinable internal static func _jvpSubtract(lhs: Self.Scalar, rhs: Self) -> (value: Self, differential: (Self.Scalar.TangentVector, Self.TangentVector) -> Self.TangentVector) {
|
|
2017
|
+
return (lhs - rhs, { ltan, rtan in
|
|
2018
|
+
return ltan - rtan
|
|
2019
|
+
})
|
|
2020
|
+
}
|
|
2021
|
+
@derivative(of: +, wrt: (lhs, rhs))
|
|
2022
|
+
@inlinable internal static func _vjpAdd(lhs: Self, rhs: Self.Scalar) -> (value: Self, pullback: (Self.TangentVector) -> (Self.TangentVector, Self.Scalar.TangentVector)) {
|
|
2023
|
+
return (lhs + rhs, { v in
|
|
2024
|
+
return (v, v.sum())
|
|
2025
|
+
})
|
|
2026
|
+
}
|
|
2027
|
+
@derivative(of: +, wrt: (lhs, rhs))
|
|
2028
|
+
@inlinable internal static func _jvpAdd(lhs: Self, rhs: Self.Scalar) -> (value: Self, differential: (Self.TangentVector, Self.Scalar.TangentVector) -> Self.TangentVector) {
|
|
2029
|
+
return (lhs + rhs, { ltan, rtan in
|
|
2030
|
+
return ltan + rtan
|
|
2031
|
+
})
|
|
2032
|
+
}
|
|
2033
|
+
@derivative(of: -, wrt: (lhs, rhs))
|
|
2034
|
+
@inlinable internal static func _vjpSubtract(lhs: Self, rhs: Self.Scalar) -> (value: Self, pullback: (Self.TangentVector) -> (Self.TangentVector, Self.Scalar.TangentVector)) {
|
|
2035
|
+
return (lhs - rhs, { v in
|
|
2036
|
+
return (v, -v.sum())
|
|
2037
|
+
})
|
|
2038
|
+
}
|
|
2039
|
+
@derivative(of: -, wrt: (lhs, rhs))
|
|
2040
|
+
@inlinable internal static func _jvpSubtract(lhs: Self, rhs: Self.Scalar) -> (value: Self, differential: (Self.TangentVector, Self.Scalar.TangentVector) -> Self.TangentVector) {
|
|
2041
|
+
return (lhs - rhs, { ltan, rtan in
|
|
2042
|
+
return ltan - rtan
|
|
2043
|
+
})
|
|
2044
|
+
}
|
|
2045
|
+
}
|
|
2046
|
+
extension Swift::SIMD where Self : _Differentiation::Differentiable, Self == Self.TangentVector, Self.Scalar : Swift::BinaryFloatingPoint, Self.Scalar : _Differentiation::Differentiable, Self.Scalar == Self.Scalar.TangentVector {
|
|
2047
|
+
@derivative(of: *, wrt: (lhs, rhs))
|
|
2048
|
+
@inlinable internal static func _vjpMultiply(lhs: Self, rhs: Self.Scalar) -> (value: Self, pullback: (Self.TangentVector) -> (Self.TangentVector, Self.Scalar.TangentVector)) {
|
|
2049
|
+
return (lhs * rhs, { v in
|
|
2050
|
+
return (v * rhs, (v * lhs).sum())
|
|
2051
|
+
})
|
|
2052
|
+
}
|
|
2053
|
+
@derivative(of: *, wrt: (lhs, rhs))
|
|
2054
|
+
@inlinable internal static func _jvpMultiply(lhs: Self, rhs: Self.Scalar) -> (value: Self, differential: (Self.TangentVector, Self.Scalar.TangentVector) -> Self.TangentVector) {
|
|
2055
|
+
return (lhs * rhs, { ltan, rtan in
|
|
2056
|
+
return lhs * rtan + ltan * rhs
|
|
2057
|
+
})
|
|
2058
|
+
}
|
|
2059
|
+
@derivative(of: /, wrt: (lhs, rhs))
|
|
2060
|
+
@inlinable internal static func _vjpDivide(lhs: Self, rhs: Self.Scalar) -> (value: Self, pullback: (Self.TangentVector) -> (Self.TangentVector, Self.Scalar.TangentVector)) {
|
|
2061
|
+
return (lhs / rhs, { v in
|
|
2062
|
+
(v / rhs, (-lhs / (rhs * rhs) * v).sum())
|
|
2063
|
+
})
|
|
2064
|
+
}
|
|
2065
|
+
@derivative(of: /, wrt: (lhs, rhs))
|
|
2066
|
+
@inlinable internal static func _jvpDivide(lhs: Self, rhs: Self.Scalar) -> (value: Self, differential: (Self.TangentVector, Self.Scalar.TangentVector) -> Self.TangentVector) {
|
|
2067
|
+
return (lhs / rhs, { ltan, rtan in
|
|
2068
|
+
(ltan * rhs - lhs * rtan) / (rhs * rhs)
|
|
2069
|
+
})
|
|
2070
|
+
}
|
|
2071
|
+
@derivative(of: *, wrt: (lhs, rhs))
|
|
2072
|
+
@inlinable internal static func _vjpMultiply(lhs: Self.Scalar, rhs: Self) -> (value: Self, pullback: (Self.TangentVector) -> (Self.Scalar.TangentVector, Self.TangentVector)) {
|
|
2073
|
+
return (lhs * rhs, { v in
|
|
2074
|
+
return ((v * rhs).sum(), v * lhs)
|
|
2075
|
+
})
|
|
2076
|
+
}
|
|
2077
|
+
@derivative(of: *, wrt: (lhs, rhs))
|
|
2078
|
+
@inlinable internal static func _jvpMultiply(lhs: Self.Scalar, rhs: Self) -> (value: Self, differential: (Self.Scalar.TangentVector, Self.TangentVector) -> Self.TangentVector) {
|
|
2079
|
+
return (lhs * rhs, { ltan, rtan in
|
|
2080
|
+
return lhs * rtan + ltan * rhs
|
|
2081
|
+
})
|
|
2082
|
+
}
|
|
2083
|
+
@derivative(of: /, wrt: (lhs, rhs))
|
|
2084
|
+
@inlinable internal static func _vjpDivide(lhs: Self.Scalar, rhs: Self) -> (value: Self, pullback: (Self.TangentVector) -> (Self.Scalar.TangentVector, Self.TangentVector)) {
|
|
2085
|
+
return (lhs / rhs, { v in
|
|
2086
|
+
((v / rhs).sum(), -lhs / (rhs * rhs) * v)
|
|
2087
|
+
})
|
|
2088
|
+
}
|
|
2089
|
+
@derivative(of: /, wrt: (lhs, rhs))
|
|
2090
|
+
@inlinable internal static func _jvpDivide(lhs: Self.Scalar, rhs: Self) -> (value: Self, differential: (Self.Scalar.TangentVector, Self.TangentVector) -> Self.TangentVector) {
|
|
2091
|
+
return (lhs / rhs, { ltan, rtan in
|
|
2092
|
+
(ltan * rhs - lhs * rtan) / (rhs * rhs)
|
|
2093
|
+
})
|
|
2094
|
+
}
|
|
2095
|
+
}
|
|
2096
|
+
extension Swift::SIMD where Self : _Differentiation::Differentiable, Self == Self.TangentVector, Self.Scalar : Swift::BinaryFloatingPoint, Self.Scalar : _Differentiation::Differentiable, Self.Scalar.TangentVector : Swift::BinaryFloatingPoint {
|
|
2097
|
+
@derivative(of: sum, wrt: self)
|
|
2098
|
+
@inlinable @_alwaysEmitIntoClient internal func _vjpSum() -> (value: Self.Scalar, pullback: (Self.Scalar.TangentVector) -> Self.TangentVector) {
|
|
2099
|
+
return (sum(), { v in Self(repeating: Scalar(v)) })
|
|
2100
|
+
}
|
|
2101
|
+
@derivative(of: sum, wrt: self)
|
|
2102
|
+
@inlinable @_alwaysEmitIntoClient internal func _jvpSum() -> (value: Self.Scalar, differential: (Self.TangentVector) -> Self.Scalar.TangentVector) {
|
|
2103
|
+
return (sum(), { v in Scalar.TangentVector(v.sum()) })
|
|
2104
|
+
}
|
|
2105
|
+
}
|
|
2106
|
+
extension Swift::SIMD where Self : _Differentiation::Differentiable, Self == Self.TangentVector, Self.Scalar : Swift::BinaryFloatingPoint, Self.Scalar : _Differentiation::Differentiable, Self.Scalar == Self.Scalar.TangentVector {
|
|
2107
|
+
@derivative(of: init(repeating:), wrt: value)
|
|
2108
|
+
@inlinable internal static func _vjpInit(repeating value: Self.Scalar) -> (value: Self, pullback: (Self.TangentVector) -> Self.Scalar.TangentVector) {
|
|
2109
|
+
return (Self(repeating: value), { v in v.sum() })
|
|
2110
|
+
}
|
|
2111
|
+
@derivative(of: init(repeating:), wrt: value)
|
|
2112
|
+
@inlinable internal static func _jvpInit(repeating value: Self.Scalar) -> (value: Self, differential: (Self.Scalar.TangentVector) -> Self.TangentVector) {
|
|
2113
|
+
return (Self(repeating: value), { v in Self(repeating: v) })
|
|
2114
|
+
}
|
|
2115
|
+
}
|
|
2116
|
+
extension Swift::SIMD2 where Scalar == Swift::Float {
|
|
2117
|
+
@derivative(of: init(repeating:), wrt: value)
|
|
2118
|
+
@inlinable @_alwaysEmitIntoClient internal static func _vjpInit(repeating value: Scalar) -> (value: Swift::SIMD2<Scalar>, pullback: (Swift::SIMD2<Scalar>._Differentiation::TangentVector) -> Swift::Float._Differentiation::TangentVector) {
|
|
2119
|
+
return (Self(repeating: value), { v in v.sum() })
|
|
2120
|
+
}
|
|
2121
|
+
@derivative(of: init(repeating:), wrt: value)
|
|
2122
|
+
@inlinable @_alwaysEmitIntoClient internal static func _jvpInit(repeating value: Scalar) -> (value: Swift::SIMD2<Scalar>, differential: (Swift::Float._Differentiation::TangentVector) -> Swift::SIMD2<Scalar>._Differentiation::TangentVector) {
|
|
2123
|
+
return (Self(repeating: value), { v in Self(repeating: v) })
|
|
2124
|
+
}
|
|
2125
|
+
}
|
|
2126
|
+
extension Swift::SIMD4 where Scalar == Swift::Float {
|
|
2127
|
+
@derivative(of: init(repeating:), wrt: value)
|
|
2128
|
+
@inlinable @_alwaysEmitIntoClient internal static func _vjpInit(repeating value: Scalar) -> (value: Swift::SIMD4<Scalar>, pullback: (Swift::SIMD4<Scalar>._Differentiation::TangentVector) -> Swift::Float._Differentiation::TangentVector) {
|
|
2129
|
+
return (Self(repeating: value), { v in v.sum() })
|
|
2130
|
+
}
|
|
2131
|
+
@derivative(of: init(repeating:), wrt: value)
|
|
2132
|
+
@inlinable @_alwaysEmitIntoClient internal static func _jvpInit(repeating value: Scalar) -> (value: Swift::SIMD4<Scalar>, differential: (Swift::Float._Differentiation::TangentVector) -> Swift::SIMD4<Scalar>._Differentiation::TangentVector) {
|
|
2133
|
+
return (Self(repeating: value), { v in Self(repeating: v) })
|
|
2134
|
+
}
|
|
2135
|
+
}
|
|
2136
|
+
extension Swift::SIMD8 where Scalar == Swift::Float {
|
|
2137
|
+
@derivative(of: init(repeating:), wrt: value)
|
|
2138
|
+
@inlinable @_alwaysEmitIntoClient internal static func _vjpInit(repeating value: Scalar) -> (value: Swift::SIMD8<Scalar>, pullback: (Swift::SIMD8<Scalar>._Differentiation::TangentVector) -> Swift::Float._Differentiation::TangentVector) {
|
|
2139
|
+
return (Self(repeating: value), { v in v.sum() })
|
|
2140
|
+
}
|
|
2141
|
+
@derivative(of: init(repeating:), wrt: value)
|
|
2142
|
+
@inlinable @_alwaysEmitIntoClient internal static func _jvpInit(repeating value: Scalar) -> (value: Swift::SIMD8<Scalar>, differential: (Swift::Float._Differentiation::TangentVector) -> Swift::SIMD8<Scalar>._Differentiation::TangentVector) {
|
|
2143
|
+
return (Self(repeating: value), { v in Self(repeating: v) })
|
|
2144
|
+
}
|
|
2145
|
+
}
|
|
2146
|
+
extension Swift::SIMD16 where Scalar == Swift::Float {
|
|
2147
|
+
@derivative(of: init(repeating:), wrt: value)
|
|
2148
|
+
@inlinable @_alwaysEmitIntoClient internal static func _vjpInit(repeating value: Scalar) -> (value: Swift::SIMD16<Scalar>, pullback: (Swift::SIMD16<Scalar>._Differentiation::TangentVector) -> Swift::Float._Differentiation::TangentVector) {
|
|
2149
|
+
return (Self(repeating: value), { v in v.sum() })
|
|
2150
|
+
}
|
|
2151
|
+
@derivative(of: init(repeating:), wrt: value)
|
|
2152
|
+
@inlinable @_alwaysEmitIntoClient internal static func _jvpInit(repeating value: Scalar) -> (value: Swift::SIMD16<Scalar>, differential: (Swift::Float._Differentiation::TangentVector) -> Swift::SIMD16<Scalar>._Differentiation::TangentVector) {
|
|
2153
|
+
return (Self(repeating: value), { v in Self(repeating: v) })
|
|
2154
|
+
}
|
|
2155
|
+
}
|
|
2156
|
+
extension Swift::SIMD32 where Scalar == Swift::Float {
|
|
2157
|
+
@derivative(of: init(repeating:), wrt: value)
|
|
2158
|
+
@inlinable @_alwaysEmitIntoClient internal static func _vjpInit(repeating value: Scalar) -> (value: Swift::SIMD32<Scalar>, pullback: (Swift::SIMD32<Scalar>._Differentiation::TangentVector) -> Swift::Float._Differentiation::TangentVector) {
|
|
2159
|
+
return (Self(repeating: value), { v in v.sum() })
|
|
2160
|
+
}
|
|
2161
|
+
@derivative(of: init(repeating:), wrt: value)
|
|
2162
|
+
@inlinable @_alwaysEmitIntoClient internal static func _jvpInit(repeating value: Scalar) -> (value: Swift::SIMD32<Scalar>, differential: (Swift::Float._Differentiation::TangentVector) -> Swift::SIMD32<Scalar>._Differentiation::TangentVector) {
|
|
2163
|
+
return (Self(repeating: value), { v in Self(repeating: v) })
|
|
2164
|
+
}
|
|
2165
|
+
}
|
|
2166
|
+
extension Swift::SIMD64 where Scalar == Swift::Float {
|
|
2167
|
+
@derivative(of: init(repeating:), wrt: value)
|
|
2168
|
+
@inlinable @_alwaysEmitIntoClient internal static func _vjpInit(repeating value: Scalar) -> (value: Swift::SIMD64<Scalar>, pullback: (Swift::SIMD64<Scalar>._Differentiation::TangentVector) -> Swift::Float._Differentiation::TangentVector) {
|
|
2169
|
+
return (Self(repeating: value), { v in v.sum() })
|
|
2170
|
+
}
|
|
2171
|
+
@derivative(of: init(repeating:), wrt: value)
|
|
2172
|
+
@inlinable @_alwaysEmitIntoClient internal static func _jvpInit(repeating value: Scalar) -> (value: Swift::SIMD64<Scalar>, differential: (Swift::Float._Differentiation::TangentVector) -> Swift::SIMD64<Scalar>._Differentiation::TangentVector) {
|
|
2173
|
+
return (Self(repeating: value), { v in Self(repeating: v) })
|
|
2174
|
+
}
|
|
2175
|
+
}
|
|
2176
|
+
extension Swift::SIMD3 where Scalar == Swift::Float {
|
|
2177
|
+
@derivative(of: init(repeating:), wrt: value)
|
|
2178
|
+
@inlinable @_alwaysEmitIntoClient internal static func _vjpInit(repeating value: Scalar) -> (value: Swift::SIMD3<Scalar>, pullback: (Swift::SIMD3<Scalar>._Differentiation::TangentVector) -> Swift::Float._Differentiation::TangentVector) {
|
|
2179
|
+
return (Self(repeating: value), { v in v.sum() })
|
|
2180
|
+
}
|
|
2181
|
+
@derivative(of: init(repeating:), wrt: value)
|
|
2182
|
+
@inlinable @_alwaysEmitIntoClient internal static func _jvpInit(repeating value: Scalar) -> (value: Swift::SIMD3<Scalar>, differential: (Swift::Float._Differentiation::TangentVector) -> Swift::SIMD3<Scalar>._Differentiation::TangentVector) {
|
|
2183
|
+
return (Self(repeating: value), { v in Self(repeating: v) })
|
|
2184
|
+
}
|
|
2185
|
+
}
|
|
2186
|
+
extension Swift::SIMD2 where Scalar == Swift::Double {
|
|
2187
|
+
@derivative(of: init(repeating:), wrt: value)
|
|
2188
|
+
@inlinable @_alwaysEmitIntoClient internal static func _vjpInit(repeating value: Scalar) -> (value: Swift::SIMD2<Scalar>, pullback: (Swift::SIMD2<Scalar>._Differentiation::TangentVector) -> Swift::Double._Differentiation::TangentVector) {
|
|
2189
|
+
return (Self(repeating: value), { v in v.sum() })
|
|
2190
|
+
}
|
|
2191
|
+
@derivative(of: init(repeating:), wrt: value)
|
|
2192
|
+
@inlinable @_alwaysEmitIntoClient internal static func _jvpInit(repeating value: Scalar) -> (value: Swift::SIMD2<Scalar>, differential: (Swift::Double._Differentiation::TangentVector) -> Swift::SIMD2<Scalar>._Differentiation::TangentVector) {
|
|
2193
|
+
return (Self(repeating: value), { v in Self(repeating: v) })
|
|
2194
|
+
}
|
|
2195
|
+
}
|
|
2196
|
+
extension Swift::SIMD4 where Scalar == Swift::Double {
|
|
2197
|
+
@derivative(of: init(repeating:), wrt: value)
|
|
2198
|
+
@inlinable @_alwaysEmitIntoClient internal static func _vjpInit(repeating value: Scalar) -> (value: Swift::SIMD4<Scalar>, pullback: (Swift::SIMD4<Scalar>._Differentiation::TangentVector) -> Swift::Double._Differentiation::TangentVector) {
|
|
2199
|
+
return (Self(repeating: value), { v in v.sum() })
|
|
2200
|
+
}
|
|
2201
|
+
@derivative(of: init(repeating:), wrt: value)
|
|
2202
|
+
@inlinable @_alwaysEmitIntoClient internal static func _jvpInit(repeating value: Scalar) -> (value: Swift::SIMD4<Scalar>, differential: (Swift::Double._Differentiation::TangentVector) -> Swift::SIMD4<Scalar>._Differentiation::TangentVector) {
|
|
2203
|
+
return (Self(repeating: value), { v in Self(repeating: v) })
|
|
2204
|
+
}
|
|
2205
|
+
}
|
|
2206
|
+
extension Swift::SIMD8 where Scalar == Swift::Double {
|
|
2207
|
+
@derivative(of: init(repeating:), wrt: value)
|
|
2208
|
+
@inlinable @_alwaysEmitIntoClient internal static func _vjpInit(repeating value: Scalar) -> (value: Swift::SIMD8<Scalar>, pullback: (Swift::SIMD8<Scalar>._Differentiation::TangentVector) -> Swift::Double._Differentiation::TangentVector) {
|
|
2209
|
+
return (Self(repeating: value), { v in v.sum() })
|
|
2210
|
+
}
|
|
2211
|
+
@derivative(of: init(repeating:), wrt: value)
|
|
2212
|
+
@inlinable @_alwaysEmitIntoClient internal static func _jvpInit(repeating value: Scalar) -> (value: Swift::SIMD8<Scalar>, differential: (Swift::Double._Differentiation::TangentVector) -> Swift::SIMD8<Scalar>._Differentiation::TangentVector) {
|
|
2213
|
+
return (Self(repeating: value), { v in Self(repeating: v) })
|
|
2214
|
+
}
|
|
2215
|
+
}
|
|
2216
|
+
extension Swift::SIMD16 where Scalar == Swift::Double {
|
|
2217
|
+
@derivative(of: init(repeating:), wrt: value)
|
|
2218
|
+
@inlinable @_alwaysEmitIntoClient internal static func _vjpInit(repeating value: Scalar) -> (value: Swift::SIMD16<Scalar>, pullback: (Swift::SIMD16<Scalar>._Differentiation::TangentVector) -> Swift::Double._Differentiation::TangentVector) {
|
|
2219
|
+
return (Self(repeating: value), { v in v.sum() })
|
|
2220
|
+
}
|
|
2221
|
+
@derivative(of: init(repeating:), wrt: value)
|
|
2222
|
+
@inlinable @_alwaysEmitIntoClient internal static func _jvpInit(repeating value: Scalar) -> (value: Swift::SIMD16<Scalar>, differential: (Swift::Double._Differentiation::TangentVector) -> Swift::SIMD16<Scalar>._Differentiation::TangentVector) {
|
|
2223
|
+
return (Self(repeating: value), { v in Self(repeating: v) })
|
|
2224
|
+
}
|
|
2225
|
+
}
|
|
2226
|
+
extension Swift::SIMD32 where Scalar == Swift::Double {
|
|
2227
|
+
@derivative(of: init(repeating:), wrt: value)
|
|
2228
|
+
@inlinable @_alwaysEmitIntoClient internal static func _vjpInit(repeating value: Scalar) -> (value: Swift::SIMD32<Scalar>, pullback: (Swift::SIMD32<Scalar>._Differentiation::TangentVector) -> Swift::Double._Differentiation::TangentVector) {
|
|
2229
|
+
return (Self(repeating: value), { v in v.sum() })
|
|
2230
|
+
}
|
|
2231
|
+
@derivative(of: init(repeating:), wrt: value)
|
|
2232
|
+
@inlinable @_alwaysEmitIntoClient internal static func _jvpInit(repeating value: Scalar) -> (value: Swift::SIMD32<Scalar>, differential: (Swift::Double._Differentiation::TangentVector) -> Swift::SIMD32<Scalar>._Differentiation::TangentVector) {
|
|
2233
|
+
return (Self(repeating: value), { v in Self(repeating: v) })
|
|
2234
|
+
}
|
|
2235
|
+
}
|
|
2236
|
+
extension Swift::SIMD64 where Scalar == Swift::Double {
|
|
2237
|
+
@derivative(of: init(repeating:), wrt: value)
|
|
2238
|
+
@inlinable @_alwaysEmitIntoClient internal static func _vjpInit(repeating value: Scalar) -> (value: Swift::SIMD64<Scalar>, pullback: (Swift::SIMD64<Scalar>._Differentiation::TangentVector) -> Swift::Double._Differentiation::TangentVector) {
|
|
2239
|
+
return (Self(repeating: value), { v in v.sum() })
|
|
2240
|
+
}
|
|
2241
|
+
@derivative(of: init(repeating:), wrt: value)
|
|
2242
|
+
@inlinable @_alwaysEmitIntoClient internal static func _jvpInit(repeating value: Scalar) -> (value: Swift::SIMD64<Scalar>, differential: (Swift::Double._Differentiation::TangentVector) -> Swift::SIMD64<Scalar>._Differentiation::TangentVector) {
|
|
2243
|
+
return (Self(repeating: value), { v in Self(repeating: v) })
|
|
2244
|
+
}
|
|
2245
|
+
}
|
|
2246
|
+
extension Swift::SIMD3 where Scalar == Swift::Double {
|
|
2247
|
+
@derivative(of: init(repeating:), wrt: value)
|
|
2248
|
+
@inlinable @_alwaysEmitIntoClient internal static func _vjpInit(repeating value: Scalar) -> (value: Swift::SIMD3<Scalar>, pullback: (Swift::SIMD3<Scalar>._Differentiation::TangentVector) -> Swift::Double._Differentiation::TangentVector) {
|
|
2249
|
+
return (Self(repeating: value), { v in v.sum() })
|
|
2250
|
+
}
|
|
2251
|
+
@derivative(of: init(repeating:), wrt: value)
|
|
2252
|
+
@inlinable @_alwaysEmitIntoClient internal static func _jvpInit(repeating value: Scalar) -> (value: Swift::SIMD3<Scalar>, differential: (Swift::Double._Differentiation::TangentVector) -> Swift::SIMD3<Scalar>._Differentiation::TangentVector) {
|
|
2253
|
+
return (Self(repeating: value), { v in Self(repeating: v) })
|
|
2254
|
+
}
|
|
2255
|
+
}
|
|
2256
|
+
extension _Differentiation::AnyDerivative._Differentiation::OpaqueZero : Swift::Sendable {}
|
|
2257
|
+
extension _Differentiation::AnyDerivative._Differentiation::OpaqueZero : Swift::BitwiseCopyable {}
|