(dresult)
| 1018 | self_device = self.device |
| 1019 | |
| 1020 | def grad_fun(dresult): |
| 1021 | return [ |
| 1022 | dresult._copy(device_name=self_device) |
| 1023 | if hasattr(dresult, "_copy") else dresult |
| 1024 | ] |
| 1025 | |
| 1026 | tape.record_operation("_copy", [new_tensor], [self], grad_fun) |
| 1027 | return new_tensor |