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

Before Change


        // try conversion, if failed then need handle by user.
        tensor = np.ndarray(tensor, dtype=np.float32)
    shape = tensor.shape
    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))

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)
    return Summary(value=[Summary.Value(tag=tag, image=image)])

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

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: maciejkula/spotlight
Commit Name: 70e4d7fe60a9658bb27b9f5fb67592a1222b2ec3
Time: 2017-07-06
Author: maciej.kula@gmail.com
File Name: spotlight/sequence/representations.py
Class Name: LSTMNet
Method Name: user_representation


Project Name: maciejkula/spotlight
Commit Name: fcf346e85356a73472a10c564a0a40011139f6be
Time: 2017-07-02
Author: maciej.kula@gmail.com
File Name: spotlight/sequence/representations.py
Class Name: CNNNet
Method Name: user_representation


Project Name: maciejkula/spotlight
Commit Name: 70e4d7fe60a9658bb27b9f5fb67592a1222b2ec3
Time: 2017-07-06
Author: maciej.kula@gmail.com
File Name: spotlight/sequence/representations.py
Class Name: CNNNet
Method Name: user_representation