ezpz.log.styleΒΆ
src/ezpz/log/style.py
make_layout(ratio=4, visible=True)
ΒΆ
Define the layout.
Source code in src/ezpz/log/style.py
print_config(config, resolve=True, print_order=None)
ΒΆ
Prints content of DictConfig using Rich library and its tree structure.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
DictConfig
|
Configuration composed by Hydra. |
required |
print_order
|
Sequence[str]
|
Determines in what order config components are printed. |
None
|
resolve
|
bool
|
Whether to resolve reference fields of DictConfig. |
True
|
Source code in src/ezpz/log/style.py
printarr(*arrs, float_width=6)
ΒΆ
Print a pretty table giving name, shape, dtype, type, and content information for input tensors or scalars.
Call like: printarr(my_arr, some_other_arr, maybe_a_scalar). Accepts a variable number of arguments.
Inputs can be
- Numpy tensor arrays
- Pytorch tensor arrays
- Jax tensor arrays
- Python ints / floats
- None
It may also work with other array-like types, but they have not been tested
Use the float_width option specify the precision to which floating point
types are printed.
Author: Nicholas Sharp (nmwsharp.com) Canonical source: https://gist.github.com/nmwsharp/54d04af87872a4988809f128e1a1d233 License: This snippet may be used under an MIT license, and it is also released into the public domain. Please retain this docstring as a reference.
Source code in src/ezpz/log/style.py
270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 | |