Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split layer in python #497

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Split layer in python #497

wants to merge 5 commits into from

Conversation

voropz
Copy link
Contributor

@voropz voropz commented Dec 7, 2021

Signed-off-by: voropz [email protected]

Signed-off-by: voropz <[email protected]>
Signed-off-by: voropz <[email protected]>
@voropz voropz marked this pull request as ready for review December 9, 2021 16:25
@voropz voropz changed the title [WIP] Split layer in python Split layer in python Dec 9, 2021
@staticmethod
def __sizes_to_array(sizes) -> numpy.ndarray:
sizes = numpy.array(sizes, dtype=numpy.int32)
if sizes.ndim != 1 or sizes.size > 3:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you have the upper limit of 3 here? It should be up to 31...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, it was in the original layer. But that's a mistake! It should be 31. (MathEngine can handle split/merge with up to 32 parts).

@@ -62,7 +62,7 @@ def check_input_layers(input_layers, layer_count):
layers.append(i._internal)
outputs.append(0)
elif isinstance(i, (list, tuple)) and len(i) == 2 and isinstance(i[0], Layer) and isinstance(i[1], int):
if int(i[1]) < 0 or int(i[1]) >= i[0].output_count():
if int(i[1]) < 0:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need this? Looks like a bug...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ты письмо читал?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants