Returns an image as a numpy array (complete with channel as dim 0) with contents that iterate like an arange.
(size, dtype=np.float32, offset=0)
| 432 | |
| 433 | |
| 434 | def get_arange_img(size, dtype=np.float32, offset=0): |
| 435 | """ |
| 436 | Returns an image as a numpy array (complete with channel as dim 0) |
| 437 | with contents that iterate like an arange. |
| 438 | """ |
| 439 | n_elem = np.prod(size) |
| 440 | img = np.arange(offset, offset + n_elem, dtype=dtype).reshape(size) |
| 441 | return np.expand_dims(img, 0) |
| 442 | |
| 443 | |
| 444 | class DistTestCase(unittest.TestCase): |
no outgoing calls
no test coverage detected
searching dependent graphs…