Skip to content

Commit

Permalink
Fix concatenation of tensors for axis < rank, v 0.9.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Dobiasd committed Sep 9, 2019
1 parent b80f34a commit e417939
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ list(APPEND CMAKE_MODULE_PATH "${FDEEP_TOP_DIR}/cmake")

include(cmake/hunter.cmake) # default off

project(frugally-deep VERSION 0.9.5)
project(frugally-deep VERSION 0.9.6)

message(STATUS "===( ${PROJECT_NAME} ${PROJECT_VERSION} )===")

Expand Down
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Just add a *conanfile.txt* with frugally-deep as a requirement and chose the gen

```
[requires]
frugally-deep/v0.9.5-p0@dobiasd/stable
frugally-deep/v0.9.6-p0@dobiasd/stable
[generators]
cmake
Expand Down
2 changes: 1 addition & 1 deletion include/fdeep/tensor5.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ inline tensor5 concatenate_tensor5s(const tensor5s& ts, std::int32_t axis)
{
axis = axis + static_cast<std::int32_t>(rank) + 1;
}
axis = axis - static_cast<std::int32_t>(rank) + 5;
axis = std::min(5, axis - static_cast<std::int32_t>(rank) + 5);
if (axis == 5)
{
return concatenate_tensor5s_depth(ts);
Expand Down
16 changes: 16 additions & 0 deletions keras_export/generate_test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@ def get_test_model_small():
(1,),
(2,),
(1,),
(1, 3),
(1, 4),
(1, 1, 3),
(1, 1, 4),
(1, 1, 1, 3),
(1, 1, 1, 4),
(1, 1, 1, 1, 3),
(1, 1, 1, 1, 4),
]

inputs = [Input(shape=s) for s in input_shapes]
Expand All @@ -121,6 +129,14 @@ def get_test_model_small():
outputs.append(Concatenate(axis=axis)([inputs[6], inputs[7]]))
for axis in [-1, 1]:
outputs.append(Concatenate(axis=axis)([inputs[8], inputs[9]]))
for axis in [-1, 2]:
outputs.append(Concatenate(axis=axis)([inputs[14], inputs[15]]))
for axis in [-1, 3]:
outputs.append(Concatenate(axis=axis)([inputs[16], inputs[17]]))
for axis in [-1, 4]:
outputs.append(Concatenate(axis=axis)([inputs[18], inputs[19]]))
for axis in [-1, 5]:
outputs.append(Concatenate(axis=axis)([inputs[20], inputs[21]]))

outputs.append(UpSampling2D(size=(1, 2), interpolation='nearest')(inputs[4]))
outputs.append(UpSampling2D(size=(5, 3), interpolation='nearest')(inputs[4]))
Expand Down

0 comments on commit e417939

Please sign in to comment.