Check that 'out' and 'targ' have the same number of elements and flatten them.
flatten_check(inp, targ)
inp
predictions
targ
targets
tensor