Skip to content

Commit

Permalink
Merge pull request #458 from staticfloat/sf/devices_yet_equal
Browse files Browse the repository at this point in the history
Add equality overrides for `Device` and `DevicePart`
  • Loading branch information
malmaud authored Oct 29, 2018
2 parents 1ce5d52 + 7c030f7 commit 8a28acb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ function get_code(s::Status)
return TF_Code(code)
end

struct DevicePart{IndexType}
@auto_hash_equals struct DevicePart{IndexType}
kind::Vector{String}
index::IndexType
end

device_index_from_zero(part::DevicePart{Int}) = "$(join(part.kind, ":")):$(part.index-1)"
device_index_from_zero(part::DevicePart) = "$(join(part.kind, ":")):$(part.index)"

struct Device
@auto_hash_equals struct Device
parts::Vector{DevicePart}
end

Expand Down

0 comments on commit 8a28acb

Please sign in to comment.