4debe684b9332a0fee78065f9d506c7119568d06,tensorboard/embedding.py,,make_sprite,#Any#Any#,11

Before Change


    if xx.size(2)==33: // https://github.com/pytorch/vision/issues/206
        sprite = torchvision.utils.make_grid(label_img, nrow=nrow, padding=0)
        sprite = sprite[:,1:,1:]
        torchvision.utils.save_image(sprite, os.path.join(save_path, "sprite.png"))
    else:
        torchvision.utils.save_image(label_img, os.path.join(save_path, "sprite.png"), nrow=nrow, padding=0)

After Change


    // this ensure we have enought space for the images
    base_size = int(math.ceil((label_img.size(0)) ** 0.5))
    // cat the images to reach the square of base_size
    label_img = torch.cat((label_img, torch.zeros(base_size ** 2 - label_img.size(0), *label_img.size()[1:])), 0)
    // this call make_grid insied, but now we can ensure a square grid
    torchvision.utils.save_image(label_img, os.path.join(save_path, "sprite.png"), nrow=base_size, padding=0)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: lanpa/tensorboardX
Commit Name: 4debe684b9332a0fee78065f9d506c7119568d06
Time: 2017-08-15
Author: 178844@studenti.unimore.it
File Name: tensorboard/embedding.py
Class Name:
Method Name: make_sprite


Project Name: rusty1s/pytorch_geometric
Commit Name: dc7bb95616baa99511a579f63c35de51b91d8afb
Time: 2017-12-10
Author: matthias.fey@tu-dortmund.de
File Name: torch_geometric/datasets/cuneiform.py
Class Name: Cuneiform
Method Name: __init__


Project Name: rusty1s/pytorch_geometric
Commit Name: cce8409beb4c1b662de2b9635cd723993184be23
Time: 2017-11-10
Author: matthias.fey@tu-dortmund.de
File Name: torch_geometric/datasets/utils/faust_monet.py
Class Name:
Method Name: