Skip to content

Commit 051fd8d

Browse files
committed
update
1 parent de71290 commit 051fd8d

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

csrc/tensor.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@ class Tensor : public std::enable_shared_from_this<Tensor> {
3434
maxIdx--; // 1 less
3535
}
3636

37+
std::string tensor_shape_str() {
38+
std::string shape_str = "(";
39+
for (auto& e : this->shape) {
40+
shape_str += std::to_string(e) + ", ";
41+
}
42+
shape_str += ")";
43+
return shape_str;
44+
}
45+
3746
void set(std::vector<int> idx, std::shared_ptr<Value> _v) {
3847
int original_idx = normalize_idx(idx);
3948
if ((original_idx < this->minIdx) || (original_idx > this->maxIdx)) {

0 commit comments

Comments
 (0)