(dims)
| 430 | return reduce(lambda x, y: f("*", x, y), map(dim2val, dims)) |
| 431 | |
| 432 | def concat_dims(dims): |
| 433 | if len(dims) == 0: |
| 434 | return c([1], dtype=np.int32, device=device) |
| 435 | else: |
| 436 | shape = dims[0] |
| 437 | for dim in dims[1:]: |
| 438 | shape = f(builtin.Concat(axis=0, comp_node=device), shape, dim) |
| 439 | return shape |
| 440 | |
| 441 | def reduce_sum(x, axis): |
| 442 | if len(axis) == 0: |