Skip to content

Commit f08f684

Browse files
blicklydsmilkov
authored andcommitted
Remove unnecessarily mutable exports from tfjs-converter (#2509)
DEV Mutable ESM exports can be difficult to reason about and are often not necessary. Remove them in places that can use export const instead. (At Google internally we forbid them and we are now cleaning up existing usages.)
1 parent 10902ae commit f08f684

14 files changed

+14
-14
lines changed

tfjs-converter/src/operations/executors/arithmetic_executor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {InternalOpExecutor, Node} from '../types';
2323

2424
import {getParamValue} from './utils';
2525

26-
export let executeOp: InternalOpExecutor = (node: Node,
26+
export const executeOp: InternalOpExecutor = (node: Node,
2727
tensorMap: NamedTensorsMap,
2828
context: ExecutionContext):
2929
tfc.Tensor[] => {

tfjs-converter/src/operations/executors/basic_math_executor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {InternalOpExecutor, Node} from '../types';
2323

2424
import {getParamValue, getTensor} from './utils';
2525

26-
export let executeOp: InternalOpExecutor = (node: Node,
26+
export const executeOp: InternalOpExecutor = (node: Node,
2727
tensorMap: NamedTensorsMap,
2828
context: ExecutionContext):
2929
tfc.Tensor[] => {

tfjs-converter/src/operations/executors/convolution_executor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {InternalOpExecutor, Node} from '../types';
2323

2424
import {getParamValue} from './utils';
2525

26-
export let executeOp: InternalOpExecutor =
26+
export const executeOp: InternalOpExecutor =
2727
(node: Node, tensorMap: NamedTensorsMap,
2828
context: ExecutionContext): tfc.Tensor[] => {
2929
switch (node.op) {

tfjs-converter/src/operations/executors/creation_executor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {InternalOpExecutor, Node} from '../types';
2323

2424
import {getParamValue} from './utils';
2525

26-
export let executeOp: InternalOpExecutor = (node: Node,
26+
export const executeOp: InternalOpExecutor = (node: Node,
2727
tensorMap: NamedTensorsMap,
2828
context: ExecutionContext):
2929
tfc.Tensor[] => {

tfjs-converter/src/operations/executors/evaluation_executor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {InternalOpExecutor, Node} from '../types';
2323

2424
import {getParamValue} from './utils';
2525

26-
export let executeOp: InternalOpExecutor =
26+
export const executeOp: InternalOpExecutor =
2727
(node: Node, tensorMap: NamedTensorsMap,
2828
context: ExecutionContext): tfc.Tensor[] => {
2929
switch (node.op) {

tfjs-converter/src/operations/executors/graph_executor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {InternalOpExecutor, Node} from '../types';
2323

2424
import {getParamValue, getTensor} from './utils';
2525

26-
export let executeOp: InternalOpExecutor = (node: Node,
26+
export const executeOp: InternalOpExecutor = (node: Node,
2727
tensorMap: NamedTensorsMap,
2828
context: ExecutionContext):
2929
tfc.Tensor[] => {

tfjs-converter/src/operations/executors/image_executor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {InternalOpExecutor, Node} from '../types';
2323

2424
import {getParamValue} from './utils';
2525

26-
export let executeOp: InternalOpExecutor = (node: Node,
26+
export const executeOp: InternalOpExecutor = (node: Node,
2727
tensorMap: NamedTensorsMap,
2828
context: ExecutionContext):
2929
tfc.Tensor[] => {

tfjs-converter/src/operations/executors/logical_executor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {InternalOpExecutor, Node} from '../types';
2323

2424
import {getParamValue} from './utils';
2525

26-
export let executeOp: InternalOpExecutor = (node: Node,
26+
export const executeOp: InternalOpExecutor = (node: Node,
2727
tensorMap: NamedTensorsMap,
2828
context: ExecutionContext):
2929
tfc.Tensor[] => {

tfjs-converter/src/operations/executors/matrices_executor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {InternalOpExecutor, Node} from '../types';
2323

2424
import {getParamValue} from './utils';
2525

26-
export let executeOp: InternalOpExecutor = (node: Node,
26+
export const executeOp: InternalOpExecutor = (node: Node,
2727
tensorMap: NamedTensorsMap,
2828
context: ExecutionContext):
2929
tfc.Tensor[] => {

tfjs-converter/src/operations/executors/normalization_executor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {InternalOpExecutor, Node} from '../types';
2323

2424
import {getParamValue} from './utils';
2525

26-
export let executeOp: InternalOpExecutor = (node: Node,
26+
export const executeOp: InternalOpExecutor = (node: Node,
2727
tensorMap: NamedTensorsMap,
2828
context: ExecutionContext):
2929
tfc.Tensor[] => {

tfjs-converter/src/operations/executors/reduction_executor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {InternalOpExecutor, Node} from '../types';
2323

2424
import {getParamValue} from './utils';
2525

26-
export let executeOp: InternalOpExecutor = (node: Node,
26+
export const executeOp: InternalOpExecutor = (node: Node,
2727
tensorMap: NamedTensorsMap,
2828
context: ExecutionContext):
2929
tfc.Tensor[] => {

tfjs-converter/src/operations/executors/slice_join_executor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {InternalOpExecutor, Node} from '../types';
2323

2424
import {getParamValue} from './utils';
2525

26-
export let executeOp: InternalOpExecutor = (node: Node,
26+
export const executeOp: InternalOpExecutor = (node: Node,
2727
tensorMap: NamedTensorsMap,
2828
context: ExecutionContext):
2929
tfc.Tensor[] => {

tfjs-converter/src/operations/executors/spectral_executor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {InternalOpExecutor, Node} from '../types';
2323

2424
import {getParamValue} from './utils';
2525

26-
export let executeOp: InternalOpExecutor =
26+
export const executeOp: InternalOpExecutor =
2727
(node: Node, tensorMap: NamedTensorsMap,
2828
context: ExecutionContext): tfc.Tensor[] => {
2929
switch (node.op) {

tfjs-converter/src/operations/executors/transformation_executor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {InternalOpExecutor, Node} from '../types';
2323

2424
import {getParamValue, split} from './utils';
2525

26-
export let executeOp: InternalOpExecutor = (node: Node,
26+
export const executeOp: InternalOpExecutor = (node: Node,
2727
tensorMap: NamedTensorsMap,
2828
context: ExecutionContext):
2929
tfc.Tensor[] => {

0 commit comments

Comments
 (0)