File tree Expand file tree Collapse file tree 2 files changed +365
-29
lines changed Expand file tree Collapse file tree 2 files changed +365
-29
lines changed Original file line number Diff line number Diff line change
1
+ #include " tensor/tensor.h"
2
+
3
+
4
+ namespace kaldi {
5
+ namespace tensor {
6
+
7
+ // This file contains functions that operate on Tensors in various ways. To
8
+ // avoid class Tensor blowing up hugely, we implement these things outside
9
+ // class Tensor.
10
+
11
+
12
+ // Note: we use the distinction between references and pointers the same way as
13
+ // you might expect from Google-style-guide code, to reflect which Tensors'
14
+ // contents are changed (so a pointer argument might have its contents changed.
15
+ // But these are in most cases pointers to const Tensors; they can be
16
+ // donst because the metadata is not changed, even if the data is.
17
+
18
+
19
+ // Sets all elements of the tensor to zero.
20
+ void SetZero (const Tensor *tensor);
21
+
22
+ // Sets all elements of the tensor to value f (cast to whatever type
23
+ // this Tensor has).
24
+ void SetZero (float f, const Tensor *tensor);
25
+
26
+
27
+ // Return a transposed version of this Tensor that shares the underlying memory.
28
+ Tensor Transpose (const Tensor &tensor, int64_t axis1 = 0 , int64_t axis2 = 1 );
29
+
30
+
31
+ }
32
+ }
You can’t perform that action at this time.
0 commit comments