38e284c453bcdad445b300c832ec543f5a0e691e,tensorboard/summary.py,,image,#Any#Any#,149

Before Change


    height, width, channel = shape[0], shape[1], shape[2]
    if channel == 1:
        // walk around. PIL"s setting on dimension.
        tensor = np.reshape(tensor, (height, width))
    image = make_image(tensor, height, width, channel)
    return Summary(value=[Summary.Value(tag=tag, image=image)])

After Change


        assert tensor.dim()<4 and tensor.dim()>1, "input tensor should be 3 dimensional."
        if tensor.dim()==2:
            tensor = tensor.unsqueeze(0)
        tensor = tensor.cpu().permute(1,2,0).numpy()
    else:
        tensor = tensor.astype(np.float32)
    tensor = (tensor*255).astype(np.uint8)
    image = make_image(tensor)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: lanpa/tensorboardX
Commit Name: 38e284c453bcdad445b300c832ec543f5a0e691e
Time: 2017-06-23
Author: huang.dexter@gmail.com
File Name: tensorboard/summary.py
Class Name:
Method Name: image


Project Name: interactiveaudiolab/nussl
Commit Name: 055caff00ce0b411c26a3d37ccc538a5f3f47ab9
Time: 2020-03-11
Author: prem@u.northwestern.edu
File Name: nussl/separation/deep/deep_clustering.py
Class Name: DeepClustering
Method Name: extract_features


Project Name: dpressel/mead-baseline
Commit Name: da1e8c2de9b265dcb18256a0a087165faf138b42
Time: 2019-01-14
Author: blester125@users.noreply.github.com
File Name: python/baseline/pytorch/seq2seq/model.py
Class Name: EncoderDecoderModelBase
Method Name: predict