| 3185 | class To3Functor { |
| 3186 | public: |
| 3187 | Maybe<Tensor> operator()(const std::shared_ptr<Tensor>& input, |
| 3188 | const Optional<Symbol<DType>>& dtype_, bool copy) const { |
| 3189 | Symbol<DType> dtype = dtype_.value_or(input->dtype()); |
| 3190 | if (input->is_global()) { |
| 3191 | return GlobalTensorTo(input, JUST(input->parallel_desc())->device_tag(), dtype, copy); |
| 3192 | } else { |
| 3193 | auto device = JUST(input->device()); |
| 3194 | return LocalTensorTo(input, device, dtype, copy); |
| 3195 | } |
| 3196 | } |
| 3197 | }; |
| 3198 | |
| 3199 | class To4Functor { |
nothing calls this directly
no test coverage detected