Skip to content

Commit c24f85d

Browse files
committed
more NT_PROFILE()'s
1 parent 9cfd167 commit c24f85d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

nuTens/tensors/tensor.hpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ class Tensor
5858
/// @{
5959

6060
/// @brief Default constructor with no initialisation
61-
Tensor() : _dType(dtypes::kUninitScalar), _device(dtypes::kUninitDevice) {};
61+
Tensor() : _dType(dtypes::kUninitScalar), _device(dtypes::kUninitDevice) {
62+
NT_PROFILE();
63+
};
6264

6365
/// @brief Construct a 1-d array with specified values
6466
/// @arg values The values to include in the tensor
@@ -106,6 +108,8 @@ class Tensor
106108
/// @brief Set whether or not the first dimension should be interpreted as a batch dimension
107109
inline Tensor &hasBatchDim(bool hasBatchDim)
108110
{
111+
NT_PROFILE();
112+
109113
_hasBatchDim = hasBatchDim;
110114
return *this;
111115
};
@@ -516,7 +520,9 @@ template <typename Tdtype, int TnDims, dtypes::deviceType Tdevice> class Accesse
516520
{
517521

518522
public:
519-
inline AccessedTensor(const Tensor &tensor) : AccessedTensor(tensor.getTensor()) {};
523+
inline AccessedTensor(const Tensor &tensor) : AccessedTensor(tensor.getTensor()) {
524+
NT_PROFILE();
525+
};
520526

521527
private:
522528
AccessedTensor(const torch::Tensor &tensor)

0 commit comments

Comments
 (0)