Skip to content
This repository was archived by the owner on May 30, 2019. It is now read-only.

Commit 26ee6c0

Browse files
mjschockry
authored andcommitted
Rename src/binding.* to src/tf_binding.x
1 parent 4e303ac commit 26ee6c0

12 files changed

+18
-18
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ changes.
9999
To run the website tests, point your browser to
100100
http://localhost:8080/static/test.html#script=/test_website.js
101101

102-
To build the production website, `./tools/render_website.js prod` must be run.
102+
To build the production website, `./tools/website_render.js prod` must be run.
103103

104104

105105
### Adding An Op
@@ -118,7 +118,7 @@ ops. Here is a rough outline of how to add an op
118118
respectively.
119119

120120
5. Add a test demonstrating the desired behavior in `src/api_test.ts`.
121-
The tensorflow binding can be built using `./tools/build_binding.js`
121+
The tensorflow binding can be built using `./tools/build_tf_binding.js`
122122
and the test can be run by doing `ts-node src/api_test.ts MyTest`.
123123
The DL test can be run by setting an environmental variable:
124124
`PROPEL=dl ts-node src/api_test.ts MyTest`

binding.gyp

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
'targets': [
2323
{
2424
'target_name': 'tensorflow-binding',
25-
'sources': [ 'src/binding.cc' ],
25+
'sources': [ 'src/tf_binding.cc' ],
2626
'include_dirs': [
2727
'<(tensorflow_include_dir)',
2828
'<(module_root_dir)',
File renamed without changes.

src/tf.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@
1313
limitations under the License.
1414
*/
1515
// TensorFlow backend.
16+
import { assert, assertEqual, getDType } from "./tensor_util";
1617
import {
1718
AttrDef,
1819
DTypeCode,
1920
Handle,
20-
} from "./binding";
21-
import { assert, assertEqual, getDType } from "./tensor_util";
21+
} from "./tf_binding";
2222
import * as types from "./types";
2323

2424
export let binding;
2525
export let ctx;
2626

2727
export function loadBinding(): boolean {
28-
binding = require("./load_binding");
28+
binding = require("./load_tf_binding");
2929
if (binding) {
3030
ctx = new binding.Context(); // Auto create context for now.
3131
return true;

src/binding.cc src/tf_binding.cc

File renamed without changes.
File renamed without changes.
File renamed without changes.

tools/build.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ if (process.argv.indexOf("clean") >= 0) {
66
}
77

88
(async() => {
9-
run.sh("node ./tools/build_binding.js");
9+
run.sh("node ./tools/build_tf_binding.js");
1010
run.sh("node ./tools/website_render.js");
1111
})();

tools/build_binding.js tools/build_tf_binding.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env node
2-
// build script for binding.cc
2+
// build script for tf_binding.cc
33
// There are literally two compile commands to call. Just call them here.
44

55
const { execSync } = require('child_process');
@@ -26,8 +26,8 @@ if (process.platform === "darwin" || process.platform === "linux") {
2626
// Flags for both linux and mac.
2727
let cflags = `
2828
-c
29-
-o Release/binding.o
30-
../src/binding.cc
29+
-o Release/tf_binding.o
30+
../src/tf_binding.cc
3131
-I${nodeInclude}
3232
-I${run.root}
3333
-I${run.root}/deps/libtensorflow/include
@@ -47,7 +47,7 @@ if (process.platform === "darwin" || process.platform === "linux") {
4747
let ldflags = `
4848
-L./Release
4949
-o Release/tensorflow-binding.node
50-
Release/binding.o
50+
Release/tf_binding.o
5151
-ltensorflow
5252
-m64
5353
`;

tools/cpplint.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env node
22
const run = require("./run");
3-
run.sh("python ./deps/cpplint/cpplint.py src/binding.cc src/check.h");
3+
run.sh("python ./deps/cpplint/cpplint.py src/tf_binding.cc src/check.h");

tools/package.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ if (clean) {
1717
const v = run.version();
1818
console.log("version", v);
1919

20-
// Build the binding.
21-
run.sh("node tools/build_binding.js");
20+
// Build the tensorflow binding.
21+
run.sh("node tools/build_tf_binding.js");
2222

2323
function createPackageJson(src, dst, packageJson = {}) {
2424
let p = JSON.parse(fs.readFileSync(src, "utf8"));
@@ -90,7 +90,7 @@ async function buildAndTest() {
9090
});
9191

9292
const tfPkgFn = await npmPack(config.tfPkg, async distDir => {
93-
fs.copyFileSync("src/load_binding.js", distDir + "/load_binding.js");
93+
fs.copyFileSync("src/load_tf_binding.js", distDir + "/load_tf_binding.js");
9494
// Copy over the TF binding.
9595
fs.copyFileSync("build/Release/tensorflow-binding.node",
9696
distDir + "/tensorflow-binding.node"
@@ -106,7 +106,7 @@ async function buildAndTest() {
106106
}
107107
createPackageJson("package.json", distDir + "/package.json", {
108108
name: config.tfPkg,
109-
main: "load_binding.js",
109+
main: "load_tf_binding.js",
110110
dependencies: { propel: v }
111111
});
112112
});

tools/test_node.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import "./test_isomorphic";
22

33
import "../src/disk_experiment_test";
44

5-
// Only on Node/TF should we run the binding_test.
5+
// Only on Node/TF should we run the tf_binding_test.
66
import { backend } from "../src/api";
77
if (backend === "tf") {
8-
import("../src/binding_test");
8+
import("../src/tf_binding_test");
99
}

0 commit comments

Comments
 (0)