(x, value)
| 1279 | """ |
| 1280 | |
| 1281 | def make_full_if_none(x, value): |
| 1282 | x_ndim = None if x is None else x.ndim |
| 1283 | # in general case, x will be returned here directly |
| 1284 | if x_ndim is not None and x_ndim != 1: |
| 1285 | return x |
| 1286 | |
| 1287 | C = inp.shape[1] |
| 1288 | pshape = (1, C, 1, 1) |
| 1289 | |
| 1290 | if x is None: |
| 1291 | x = Const(value, inp.dtype, inp.device) |
| 1292 | shape = astensor1d(pshape, inp, dtype="int32", device=inp.device) |
| 1293 | (result,) = apply(builtin.Broadcast(), x, shape) |
| 1294 | result.format = inp.format |
| 1295 | return result |
| 1296 | else: |
| 1297 | assert x_ndim == 1 |
| 1298 | shape = astensor1d(pshape, inp, dtype="int32", device=inp.device) |
| 1299 | (result,) = apply(builtin.Reshape(), x, shape) |
| 1300 | return result |
| 1301 | |
| 1302 | has_mean = running_mean is not None |
| 1303 | has_var = running_var is not None |
no test coverage detected