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

Method ToString

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

Source from the content-addressed store, hash-verified

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

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