Add hash() global (#18258)
authorDavid Riazati <davidriazati@fb.com>
Sat, 30 Mar 2019 01:23:28 +0000 (18:23 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Sat, 30 Mar 2019 01:29:34 +0000 (18:29 -0700)
commit7b0ef317806178b5c3e4135ef53b78f60f767991
tree4f2283813524dafcd5be4882242db2dcfa6e3948
parenta5ddecd00c4d0971e2ad8a40e7345d41cf6e1ca0
Add hash() global (#18258)

Summary:
This adds `hash()` which supports `int`, `str`, and `float`. It relies on `std::hash` which is implementation defined, so the result of `hash()` in TorchScript is not the same as in Python, but should satisfy the same properties.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18258

Differential Revision: D14692317

Pulled By: driazati

fbshipit-source-id: 909df5d024bb3feea157d5a203b7de53c72261c9
aten/src/ATen/core/interned_strings.h
test/test_jit.py
torch/csrc/jit/register_prim_ops.cpp
torch/csrc/jit/script/compiler.cpp