示例#1
0
def slice(src, dim):
    return fields_to_tensors(src, lambda s: cgpt.lattice_slice(s, dim))
示例#2
0
def slice(x, dim):
    x = gpt.eval(x)
    r = sum([numpy.array(cgpt.lattice_slice(o, dim)) for o in x.v_obj])
    return [gpt.util.value_to_tensor(v, x.otype) for v in r]