// SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved. // SPDX-License-Identifier: Apache-2.0 #pragma once #include #include #include template inline std::ostream &operator<<(std::ostream &os, const std::vector &v) { os << "["; if (! v.empty()) { os << v[0]; for (size_t i = 1; i < v.size(); ++i) { os << ", " << v[i]; } } os << "]"; return os; } template struct _inner_tuple_print { inline static std::ostream &print(std::ostream &os, const std::tuple &t) { _inner_tuple_print::print(os, t); os << ", " << std::get(t); return os; } }; template struct _inner_tuple_print<0, Args...> { inline static std::ostream &print(std::ostream &os, const std::tuple &t) { os << std::get<0>(t); return os; } }; template inline std::ostream &operator<<(std::ostream &os, const std::tuple &t) { os << "("; _inner_tuple_print::print(os, t); os << ")"; return os; } void print_tensor(const torch::Tensor &t);