| 3199 | class To4Functor { |
| 3200 | public: |
| 3201 | Maybe<Tensor> operator()(const std::shared_ptr<Tensor>& input, |
| 3202 | const std::shared_ptr<Tensor>& other, bool copy) const { |
| 3203 | CHECK_OR_RETURN(!input->is_global() && !other->is_global()) |
| 3204 | << Error::RuntimeError() |
| 3205 | << "tensor.to(other) can only be called when tensor and other are local tensors"; |
| 3206 | Symbol<DType> dtype = other->dtype(); |
| 3207 | Symbol<Device> device = JUST(other->device()); |
| 3208 | return LocalTensorTo(input, device, dtype, copy); |
| 3209 | } |
| 3210 | }; |
| 3211 | |
| 3212 | class ToDeviceFunctor { |
nothing calls this directly
no test coverage detected