From b282c88d9743fc9bb60ef27cfa5d9cf58cccd60b Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu, 3 Jul 2025 23:53:02 -0700 Subject: Make copysign function differentiable (#7585) * Initial plan * Implement copysign forward and backward derivatives Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> * Fix copysign test format to use expected.txt file Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> * Add wgsl support to copysign and fix y==0 derivative case Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> * Add wgsl support to copysign helper functions Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> * Fix copysign derivative to return 0 when either x or y is 0 Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> --- .../dstdlib-copysign.slang.expected.txt | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/autodiff-dstdlib/dstdlib-copysign.slang.expected.txt (limited to 'tests/autodiff-dstdlib/dstdlib-copysign.slang.expected.txt') diff --git a/tests/autodiff-dstdlib/dstdlib-copysign.slang.expected.txt b/tests/autodiff-dstdlib/dstdlib-copysign.slang.expected.txt new file mode 100644 index 000000000..71f3de9fd --- /dev/null +++ b/tests/autodiff-dstdlib/dstdlib-copysign.slang.expected.txt @@ -0,0 +1,21 @@ +type: float +-3.000000 +-2.000000 +2.000000 +-1.500000 +0.000000 +0.000000 +-5.000000 +-1.000000 +3.000000 +-2.000000 +-1.000000 +0.000000 +-2.000000 +0.000000 +3.000000 +0.000000 +0.000000 +0.000000 +-1.000000 +-3.000000 \ No newline at end of file -- cgit v1.2.3