MCPcopy
hub / github.com/microsoft/Cream / check_last_batch

Function check_last_batch

TinyCLIP/src/training/train.py:67–78  ·  view source on GitHub ↗

input: iterator return: (item, is_last_batch)

(it)

Source from the content-addressed store, hash-verified

65
66
67def check_last_batch(it):
68 '''
69 input: iterator
70 return: (item, is_last_batch)
71 '''
72 last = None
73 for x in it:
74 if last is not None:
75 yield last, False
76 last = x
77 if last is not None:
78 yield last, True
79
80
81NAN_LOSS_CNT = 0

Callers 1

train_one_epochFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected