Skip to content

Tensor.to(Tensor) doesn't change dtype of Tensor. #653

@kaiidams

Description

@kaiidams

PyTorch outputs torch.float64

import torch
x = torch.linspace(0, 1, 100, dtype=torch.float32)
y = torch.linspace(0, 1, 100, dtype=torch.float64)
x.to(y).dtype

TorchSharp (8005af9) outputs Float32.

// commit 8005af93ef3ebf66f3b246a4ccbe4ba791f7f9f9
using TorchSharp;
var x = torch.linspace(0, 1, 100, dtype: torch.float32);
var y = torch.linspace(0, 1, 100, dtype: torch.float64);
x.to(y).dtype

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions