Skip to main content

torch_dart 0.0.3 copy "torch_dart: ^0.0.3" to clipboard
torch_dart: ^0.0.3 copied to clipboard

Backend-independent Dart bindings for PyTorch.

example/torch_dart_example.dart

import 'package:torch_dart/torch_dart.dart' as torch;
import 'package:torch_dart/torch_dart.dart' show Torch;

void main() {
  print('PyTorch: ${Torch.version}');
  final x = torch.zeros([2, 3], dtype: .int32, device: .parse('cuda:0'));
  print(x);
  print(x.shape);
  print(x.dtype);
  print(x.device);

  final y = torch.arange(12);
  print(y);

  final z = y.reshape([3, 4]);  
  print(z);
}
0
likes
145
points
100
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Backend-independent Dart bindings for PyTorch.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

meta, py_embed

More

Packages that depend on torch_dart