Skip to content

Commit

Permalink
Fix types in set_attr_shape_list
Browse files Browse the repository at this point in the history
The lack of `Cint` for the second to last argument is particularly problematic, because TensorFlow would get incorrect values for the lengths of the shape array.
  • Loading branch information
Keno authored Nov 4, 2018
1 parent 699adf4 commit 9325475
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1355,15 +1355,15 @@ function set_attr_list(desc::NodeDescription, attr_name, list::Vector{<:DataType
end

function set_attr_shape_list(desc::NodeDescription, attr_name, list::Vector)
dims = Vector{Int}[]
dims = Vector{Int64}[]
for shape in list
push!(dims, [shape...])
push!(dims, Int64[shape...])
end
@tfcall(:TF_SetAttrShapeList, Cvoid, (Ptr{Cvoid}, Cstring, Ptr{Ptr{Int64}}, Ptr{Cint}, Cint),
desc.ptr,
attr_name,
dims,
[length(x) for x in dims],
Cint[length(x) for x in dims],
length(dims))
end

Expand Down

0 comments on commit 9325475

Please sign in to comment.