|
399 | 399 | try |
400 | 400 | operation = get_physical_operation(entry.tokenLib, item) |
401 | 401 | physical_dimension = convert(Vector{Float16}, operation(entry.physical_dimension)) |
402 | | - if !isempty(physical_dimension) |
| 402 | + if !isempty(physical_dimension) && !has_inf16(physical_dimension) |
403 | 403 | push!(entry.elements, item) |
404 | 404 | entry.physical_dimension = physical_dimension |
405 | 405 | entry.homogene = true |
|
418 | 418 | operation = get_physical_operation(entry.tokenLib, item) |
419 | 419 | last_dim = get_physical_dimension(entry.tokenLib, entry.elements[end]) |
420 | 420 | temp_dim = convert(Vector{Float16}, operation(last_dim, entry.physical_dimension)) |
421 | | - if !isempty(temp_dim) |
| 421 | + if !isempty(temp_dim) && !has_inf16(temp_dim) |
422 | 422 | entry.arity_potential = 1 |
423 | 423 | push!(entry.elements, item) |
424 | 424 | entry.physical_dimension = temp_dim |
@@ -760,7 +760,7 @@ function calculate_vector_dimension!(tree::TempComputeTree) |
760 | 760 |
|
761 | 761 |
|
762 | 762 | #needs to be revised |
763 | | - if length(dims) == 2 && isempty(tree.vector_dimension) |
| 763 | + if length(dims) == 2 && has_inf16(tree.vector_dimension) |
764 | 764 | tree.symbol = rand(point_operations) |
765 | 765 | function_op = tokenLib.physical_operation_dict[][tree.symbol] |
766 | 766 | tree.vector_dimension = function_op(dims...) |
@@ -888,9 +888,6 @@ function retrieve_exchange_from_lib(tree::TempComputeTree, |
888 | 888 | end |
889 | 889 |
|
890 | 890 | function calculate_distance(k1::Vector{Float16}, k2::Vector{Float16}) |
891 | | - if isempty(k2) || isempty(k1) |
892 | | - return Inf16 |
893 | | - end |
894 | 891 | return sqrt(sum((k1 .- k2) .^ 2)) |
895 | 892 | end |
896 | 893 |
|
@@ -1013,7 +1010,7 @@ function propagate_necessary_changes!( |
1013 | 1010 | return false |
1014 | 1011 | end |
1015 | 1012 |
|
1016 | | - if !isempty(tree.vector_dimension) && isapprox(tree.vector_dimension, expected_dim, atol=eps(Float16)) |
| 1013 | + if !has_inf16(tree.vector_dimension) && isapprox(tree.vector_dimension, expected_dim, atol=eps(Float16)) |
1017 | 1014 | return true |
1018 | 1015 | end |
1019 | 1016 |
|
|
0 commit comments