Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jerrrrry
infinilm
Commits
dd5dec97
Commit
dd5dec97
authored
Aug 08, 2025
by
wooway777
Browse files
issue/21 - removed a redundant validation
parent
93cd62d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
7 deletions
+0
-7
src/tensor/tensor.cpp
src/tensor/tensor.cpp
+0
-7
No files found.
src/tensor/tensor.cpp
View file @
dd5dec97
...
...
@@ -275,13 +275,6 @@ std::shared_ptr<Tensor> Tensor::view(const std::vector<size_t> new_shape, const
}
std
::
shared_ptr
<
Tensor
>
Tensor
::
viewReshaped
(
const
std
::
vector
<
size_t
>
new_shape
)
const
{
// First validate that the total number of elements matches
size_t
current_elements
=
std
::
accumulate
(
_desc
->
shape
().
begin
(),
_desc
->
shape
().
end
(),
1
,
std
::
multiplies
<
size_t
>
());
size_t
new_elements
=
std
::
accumulate
(
new_shape
.
begin
(),
new_shape
.
end
(),
1
,
std
::
multiplies
<
size_t
>
());
ASSERT_EQ
(
current_elements
,
new_elements
);
// Create a copy of the current shape and strides
auto
current_shape
=
_desc
->
shape
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment