Add forceReshape to Matrix

This commit is contained in:
kradchen
2023-05-05 15:03:22 +08:00
parent 5353aa53d5
commit dbd69936bd
2 changed files with 7 additions and 0 deletions

View File

@@ -300,6 +300,11 @@ namespace Aurora {
return ret;
}
void Matrix::forceReshape(int rows, int columns, int slices)
{
mInfo = {rows,columns,slices};
}
bool Matrix::compareShape(const Matrix &other) const {
if (mInfo[2] == 1 && other.mInfo[2] == 1) {
if (mInfo[0]==1 && other.mInfo[1] == 1 && mInfo[1] == other.mInfo[0]) return true;

View File

@@ -233,6 +233,8 @@ namespace Aurora {
return false;
}
void forceReshape(int rows, int columns, int slices);
private:
ValueType mValueType = Normal;
std::shared_ptr<double> mData;