MCPcopy Create free account
hub / github.com/apache/arrow / ToString

Method ToString

cpp/src/arrow/extension/variable_shape_tensor.cc:58–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58std::string VariableShapeTensorType::ToString(bool show_metadata) const {
59 std::stringstream ss;
60 ss << "extension<" << this->extension_name()
61 << "[value_type=" << value_type_->ToString(show_metadata) << ", ndim=" << ndim_;
62
63 if (!permutation_.empty()) {
64 ss << ", permutation=" << ::arrow::internal::PrintVector{permutation_, ","};
65 }
66 if (!dim_names_.empty()) {
67 ss << ", dim_names=[" << internal::JoinStrings(dim_names_, ",") << "]";
68 }
69 if (!uniform_shape_.empty()) {
70 std::vector<std::string> uniform_shape;
71 for (const auto& v : uniform_shape_) {
72 if (v.has_value()) {
73 uniform_shape.emplace_back(std::to_string(v.value()));
74 } else {
75 uniform_shape.emplace_back("null");
76 }
77 }
78 ss << ", uniform_shape=[" << internal::JoinStrings(uniform_shape, ",") << "]";
79 }
80 ss << "]>";
81 return ss.str();
82}
83
84std::string VariableShapeTensorType::Serialize() const {
85 rj::Document document;

Callers 1

DeserializeMethod · 0.45

Calls 7

JoinStringsFunction · 0.85
to_stringFunction · 0.85
emplace_backMethod · 0.80
strMethod · 0.80
extension_nameMethod · 0.45
emptyMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected