MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / operator()

Method operator()

oneflow/core/functional/impl/array_functor.cpp:3187–3196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3185class 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
3199class To4Functor {

Callers

nothing calls this directly

Calls 7

GlobalTensorToFunction · 0.85
LocalTensorToFunction · 0.85
value_orMethod · 0.45
dtypeMethod · 0.45
is_globalMethod · 0.45
parallel_descMethod · 0.45
deviceMethod · 0.45

Tested by

no test coverage detected