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

Method ToString

oneflow/api/python/framework/tensor_tuple.cpp:32–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30
31struct TensorTupleUtil final {
32 static std::string ToString(const TensorTuple& tensor_tuple) {
33 std::stringstream ss;
34 int32_t idx = 0;
35 ss << "TensorTuple(";
36 for (const std::shared_ptr<Tensor>& tensor : tensor_tuple) {
37 ss << tensor;
38 if (++idx != tensor_tuple.size() || tensor_tuple.size() == 1) { ss << ", "; }
39 }
40 ss << ")";
41 return ss.str();
42 }
43
44 static void MergeFrom(std::shared_ptr<TensorTuple>& tensor_tuple, const TensorTuple& other) {
45 for (const auto& tensor : other) { tensor_tuple->emplace_back(tensor); }

Callers 1

device.cppFile · 0.45

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected