We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent de71290 commit 051fd8dCopy full SHA for 051fd8d
1 file changed
csrc/tensor.h
@@ -34,6 +34,15 @@ class Tensor : public std::enable_shared_from_this<Tensor> {
34
maxIdx--; // 1 less
35
}
36
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
+
46
void set(std::vector<int> idx, std::shared_ptr<Value> _v) {
47
int original_idx = normalize_idx(idx);
48
if ((original_idx < this->minIdx) || (original_idx > this->maxIdx)) {
0 commit comments