question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Resolve some naming questions

See original GitHub issue
  1. I’m not particularly tied to open TorchSharp.Tensor namespace. I’d be happy with open TorchSharp or anything that gives the ergonomics you want

  2. When updating DiffSharp to latest I noticed TorchSharp.Device rather than TorchSharp.TorchDevice. Previously I was putting Torch on the front to help disambiguate w.r.t. DiffSharp “Tensor”. But I understand you’ll likely need to switch to plain Tensor. But either do one or the other

     TorchSharp.DeviceType
     TorchSharp.Device
     TorchSharp.Tensor
     TorchSharp.Scalar
    

or

    TorchSharp.TorchDeviceType
    TorchSharp.TorchDevice
    TorchSharp.TorchTensor
    TorchSharp.TorchScalar

Right now we’re a mix of these.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (11 by maintainers)

github_iconTop GitHub Comments

4reactions
NiklasGustafssoncommented, Jun 30, 2021

I had a conversation with @dyme offline, and here’s a proposal:

We will strive to make the TorchSharp experience as close to Python as possible. Among other things, this means not always following the standard .NET naming conventions.

Specifically, namespaces and classes corresponding to Python modules, will have lower-case names. Function and parameter names may have C-style casing, using underscores as word separators, instead of camel or Pascal casing.

Since namespaces cannot directly contain methods, we will continue to rely on extensive use of static classes to parallel Python modules.

We will deprecate, and eventually eliminate, the element-type-specific tensor factories, i.e. Int32Tensor, Float32Tensor, BoolTensor, etc. Instead, we will use the same mechanisms as Python does, but take advantage of static typing as appropriate.

For example, to create a 32-bit float tensor with random numbers, you will use torch.rand(...) and either pass in the element type, or rely on the default dtype set in the runtime.

Properties will, as necessary, be renamed to correspond to the PyTorch names. For example, ndims instead of dims or Dimensions

Increased reliance on overloading. Pytorch has a lot of APIs where an argument can be an integer, float, a tuple or list, or a string. TorchSharp already relies on overloading in some cases, but there are more opportunities to do so, and we will attempt to systematically do the work to give users the same flexibility as in Python, while still taking full advantage of .NET’s type system.

3reactions
NiklasGustafssoncommented, Jun 30, 2021

Note; the proposed changes will be a massive breaking change.

Read more comments on GitHub >

github_iconTop Results From Across the Web

IUPAC Nomenclature Practice Problems
Check this 69-question, Multiple-Choice Quiz with a 2-hour Video Solution on naming alkanes, alkyl halides, alkenes, alkynes, aromatic compounds, alcohols, ...
Read more >
Nomenclature of Organic Compounds Questions - Chemistry
Nomenclature of Organic Compounds Questions and Answers - Practice questions, ... has specified certain rules for the nomenclature of organic compounds.
Read more >
Naming Organic Compounds - YouTube
Naming Organic Compounds - Practice Questions and Answers From www.ChemistryTuition.Net. 3.1K views · 3 years ago ...more ...
Read more >
Chemistry Practice Problems: Naming Chemical Compounds
https://getchemistryhelp.com/learn-chemistry-fast/ These practice problems demonstrate how to name a mixture of ionic compounds, ...
Read more >
Naming Organic Compounds Tutorial Video Series
The first video shows you how to break down the name of an organic molecule using my 'puzzle piece approach'. This video is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found