MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / contiguous

Method contiguous

oneflow/core/framework/tensor.cpp:90–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90std::shared_ptr<Tensor> Parameter::contiguous() const {
91 const auto& tensor = std::const_pointer_cast<Tensor>(shared_from_this());
92 if (tensor_->is_contiguous()) { return tensor; }
93 return CHECK_JUST(functional::ToContiguous(tensor));
94}
95
96std::shared_ptr<Tensor> Parameter::pin_memory() const {
97 std::shared_ptr<Tensor> tensor = std::const_pointer_cast<Tensor>(shared_from_this());

Calls 2

ToContiguousClass · 0.85
is_contiguousMethod · 0.45