| 872 | |
| 873 | template <typename T> |
| 874 | bool ValidateInput(const Tensor& updates) { |
| 875 | const auto updates_flat = updates.flat<T>(); |
| 876 | const T zero(0); |
| 877 | for (int i = 0; i < updates.NumElements(); i++) { |
| 878 | if (updates_flat(i) == zero) return false; |
| 879 | } |
| 880 | return true; |
| 881 | } |
| 882 | |
| 883 | template <> |
| 884 | bool ValidateInput<Variant>(const Tensor& updates) { |