Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tensorflow hang when specify #192

Merged
merged 1 commit into from
Mar 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions modules/effects/schematics-core/utility/ngrx-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function addReducerToState(options: any): Rule {
export function addReducerToStateInterface(
source: ts.SourceFile,
reducersPath: string,
options: { name: string }
options: { name: string; plural: boolean }
): Change {
const stateInterface = source.statements.find(
stm => stm.kind === ts.SyntaxKind.InterfaceDeclaration
Expand All @@ -90,11 +90,12 @@ export function addReducerToStateInterface(
return new NoopChange();
}

const state = options.plural
? stringUtils.pluralize(options.name)
: stringUtils.camelize(options.name);

const keyInsert =
stringUtils.camelize(options.name) +
': from' +
stringUtils.classify(options.name) +
'.State;';
state + ': from' + stringUtils.classify(options.name) + '.State;';
const expr = node as any;
let position;
let toInsert;
Expand Down Expand Up @@ -125,7 +126,7 @@ export function addReducerToStateInterface(
export function addReducerToActionReducerMap(
source: ts.SourceFile,
reducersPath: string,
options: { name: string }
options: { name: string; plural: boolean }
): Change {
let initializer: any;
const actionReducerMap: any = source.statements
Expand All @@ -152,11 +153,12 @@ export function addReducerToActionReducerMap(

let node = actionReducerMap.initializer;

const state = options.plural
? stringUtils.pluralize(options.name)
: stringUtils.camelize(options.name);

const keyInsert =
stringUtils.camelize(options.name) +
': from' +
stringUtils.classify(options.name) +
'.reducer,';
state + ': from' + stringUtils.classify(options.name) + '.reducer,';
const expr = node as any;
let position;
let toInsert;
Expand Down
19 changes: 19 additions & 0 deletions modules/effects/schematics-core/utility/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,25 @@ export function capitalize(str: string): string {
return str.charAt(0).toUpperCase() + str.substr(1);
}

/**
Returns the plural form of a string

```javascript
'innerHTML'.pluralize() // 'InnerHTMLs'
'action_name'.pluralize() // 'actionNames'
'css-class-name'.pluralize() // 'cssClassNames'
'regex'.pluralize() // 'regexes'
'user'.pluralize() // 'users'
```
*/
export function pluralize(str: string): string {
return camelize(
[/([^aeiou])y$/, /()fe?$/, /([^aeiou]o|[sxz]|[cs]h)$/].map(
(c, i) => (str = str.replace(c, `$1${'iv'[i] || ''}e`))
) && str + 's'
);
}

export function group(name: string, group: string | undefined) {
return group ? `${group}/${name}` : name;
}
Expand Down
22 changes: 12 additions & 10 deletions modules/entity/schematics-core/utility/ngrx-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function addReducerToState(options: any): Rule {
export function addReducerToStateInterface(
source: ts.SourceFile,
reducersPath: string,
options: { name: string }
options: { name: string; plural: boolean }
): Change {
const stateInterface = source.statements.find(
stm => stm.kind === ts.SyntaxKind.InterfaceDeclaration
Expand All @@ -90,11 +90,12 @@ export function addReducerToStateInterface(
return new NoopChange();
}

const state = options.plural
? stringUtils.pluralize(options.name)
: stringUtils.camelize(options.name);

const keyInsert =
stringUtils.camelize(options.name) +
': from' +
stringUtils.classify(options.name) +
'.State;';
state + ': from' + stringUtils.classify(options.name) + '.State;';
const expr = node as any;
let position;
let toInsert;
Expand Down Expand Up @@ -125,7 +126,7 @@ export function addReducerToStateInterface(
export function addReducerToActionReducerMap(
source: ts.SourceFile,
reducersPath: string,
options: { name: string }
options: { name: string; plural: boolean }
): Change {
let initializer: any;
const actionReducerMap: any = source.statements
Expand All @@ -152,11 +153,12 @@ export function addReducerToActionReducerMap(

let node = actionReducerMap.initializer;

const state = options.plural
? stringUtils.pluralize(options.name)
: stringUtils.camelize(options.name);

const keyInsert =
stringUtils.camelize(options.name) +
': from' +
stringUtils.classify(options.name) +
'.reducer,';
state + ': from' + stringUtils.classify(options.name) + '.reducer,';
const expr = node as any;
let position;
let toInsert;
Expand Down
19 changes: 19 additions & 0 deletions modules/entity/schematics-core/utility/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,25 @@ export function capitalize(str: string): string {
return str.charAt(0).toUpperCase() + str.substr(1);
}

/**
Returns the plural form of a string

```javascript
'innerHTML'.pluralize() // 'InnerHTMLs'
'action_name'.pluralize() // 'actionNames'
'css-class-name'.pluralize() // 'cssClassNames'
'regex'.pluralize() // 'regexes'
'user'.pluralize() // 'users'
```
*/
export function pluralize(str: string): string {
return camelize(
[/([^aeiou])y$/, /()fe?$/, /([^aeiou]o|[sxz]|[cs]h)$/].map(
(c, i) => (str = str.replace(c, `$1${'iv'[i] || ''}e`))
) && str + 's'
);
}

export function group(name: string, group: string | undefined) {
return group ? `${group}/${name}` : name;
}
Expand Down
22 changes: 12 additions & 10 deletions modules/router-store/schematics-core/utility/ngrx-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function addReducerToState(options: any): Rule {
export function addReducerToStateInterface(
source: ts.SourceFile,
reducersPath: string,
options: { name: string }
options: { name: string; plural: boolean }
): Change {
const stateInterface = source.statements.find(
stm => stm.kind === ts.SyntaxKind.InterfaceDeclaration
Expand All @@ -90,11 +90,12 @@ export function addReducerToStateInterface(
return new NoopChange();
}

const state = options.plural
? stringUtils.pluralize(options.name)
: stringUtils.camelize(options.name);

const keyInsert =
stringUtils.camelize(options.name) +
': from' +
stringUtils.classify(options.name) +
'.State;';
state + ': from' + stringUtils.classify(options.name) + '.State;';
const expr = node as any;
let position;
let toInsert;
Expand Down Expand Up @@ -125,7 +126,7 @@ export function addReducerToStateInterface(
export function addReducerToActionReducerMap(
source: ts.SourceFile,
reducersPath: string,
options: { name: string }
options: { name: string; plural: boolean }
): Change {
let initializer: any;
const actionReducerMap: any = source.statements
Expand All @@ -152,11 +153,12 @@ export function addReducerToActionReducerMap(

let node = actionReducerMap.initializer;

const state = options.plural
? stringUtils.pluralize(options.name)
: stringUtils.camelize(options.name);

const keyInsert =
stringUtils.camelize(options.name) +
': from' +
stringUtils.classify(options.name) +
'.reducer,';
state + ': from' + stringUtils.classify(options.name) + '.reducer,';
const expr = node as any;
let position;
let toInsert;
Expand Down
19 changes: 19 additions & 0 deletions modules/router-store/schematics-core/utility/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,25 @@ export function capitalize(str: string): string {
return str.charAt(0).toUpperCase() + str.substr(1);
}

/**
Returns the plural form of a string

```javascript
'innerHTML'.pluralize() // 'InnerHTMLs'
'action_name'.pluralize() // 'actionNames'
'css-class-name'.pluralize() // 'cssClassNames'
'regex'.pluralize() // 'regexes'
'user'.pluralize() // 'users'
```
*/
export function pluralize(str: string): string {
return camelize(
[/([^aeiou])y$/, /()fe?$/, /([^aeiou]o|[sxz]|[cs]h)$/].map(
(c, i) => (str = str.replace(c, `$1${'iv'[i] || ''}e`))
) && str + 's'
);
}

export function group(name: string, group: string | undefined) {
return group ? `${group}/${name}` : name;
}
Expand Down
22 changes: 12 additions & 10 deletions modules/schematics-core/utility/ngrx-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function addReducerToState(options: any): Rule {
export function addReducerToStateInterface(
source: ts.SourceFile,
reducersPath: string,
options: { name: string }
options: { name: string; plural: boolean }
): Change {
const stateInterface = source.statements.find(
stm => stm.kind === ts.SyntaxKind.InterfaceDeclaration
Expand All @@ -90,11 +90,12 @@ export function addReducerToStateInterface(
return new NoopChange();
}

const state = options.plural
? stringUtils.pluralize(options.name)
: stringUtils.camelize(options.name);

const keyInsert =
stringUtils.camelize(options.name) +
': from' +
stringUtils.classify(options.name) +
'.State;';
state + ': from' + stringUtils.classify(options.name) + '.State;';
const expr = node as any;
let position;
let toInsert;
Expand Down Expand Up @@ -125,7 +126,7 @@ export function addReducerToStateInterface(
export function addReducerToActionReducerMap(
source: ts.SourceFile,
reducersPath: string,
options: { name: string }
options: { name: string; plural: boolean }
): Change {
let initializer: any;
const actionReducerMap: any = source.statements
Expand All @@ -152,11 +153,12 @@ export function addReducerToActionReducerMap(

let node = actionReducerMap.initializer;

const state = options.plural
? stringUtils.pluralize(options.name)
: stringUtils.camelize(options.name);

const keyInsert =
stringUtils.camelize(options.name) +
': from' +
stringUtils.classify(options.name) +
'.reducer,';
state + ': from' + stringUtils.classify(options.name) + '.reducer,';
const expr = node as any;
let position;
let toInsert;
Expand Down
19 changes: 19 additions & 0 deletions modules/schematics-core/utility/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,25 @@ export function capitalize(str: string): string {
return str.charAt(0).toUpperCase() + str.substr(1);
}

/**
Returns the plural form of a string

```javascript
'innerHTML'.pluralize() // 'InnerHTMLs'
'action_name'.pluralize() // 'actionNames'
'css-class-name'.pluralize() // 'cssClassNames'
'regex'.pluralize() // 'regexes'
'user'.pluralize() // 'users'
```
*/
export function pluralize(str: string): string {
return camelize(
[/([^aeiou])y$/, /()fe?$/, /([^aeiou]o|[sxz]|[cs]h)$/].map(
(c, i) => (str = str.replace(c, `$1${'iv'[i] || ''}e`))
) && str + 's'
);
}

export function group(name: string, group: string | undefined) {
return group ? `${group}/${name}` : name;
}
Expand Down
22 changes: 12 additions & 10 deletions modules/schematics/schematics-core/utility/ngrx-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function addReducerToState(options: any): Rule {
export function addReducerToStateInterface(
source: ts.SourceFile,
reducersPath: string,
options: { name: string }
options: { name: string; plural: boolean }
): Change {
const stateInterface = source.statements.find(
stm => stm.kind === ts.SyntaxKind.InterfaceDeclaration
Expand All @@ -90,11 +90,12 @@ export function addReducerToStateInterface(
return new NoopChange();
}

const state = options.plural
? stringUtils.pluralize(options.name)
: stringUtils.camelize(options.name);

const keyInsert =
stringUtils.camelize(options.name) +
': from' +
stringUtils.classify(options.name) +
'.State;';
state + ': from' + stringUtils.classify(options.name) + '.State;';
const expr = node as any;
let position;
let toInsert;
Expand Down Expand Up @@ -125,7 +126,7 @@ export function addReducerToStateInterface(
export function addReducerToActionReducerMap(
source: ts.SourceFile,
reducersPath: string,
options: { name: string }
options: { name: string; plural: boolean }
): Change {
let initializer: any;
const actionReducerMap: any = source.statements
Expand All @@ -152,11 +153,12 @@ export function addReducerToActionReducerMap(

let node = actionReducerMap.initializer;

const state = options.plural
? stringUtils.pluralize(options.name)
: stringUtils.camelize(options.name);

const keyInsert =
stringUtils.camelize(options.name) +
': from' +
stringUtils.classify(options.name) +
'.reducer,';
state + ': from' + stringUtils.classify(options.name) + '.reducer,';
const expr = node as any;
let position;
let toInsert;
Expand Down
19 changes: 19 additions & 0 deletions modules/schematics/schematics-core/utility/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,25 @@ export function capitalize(str: string): string {
return str.charAt(0).toUpperCase() + str.substr(1);
}

/**
Returns the plural form of a string

```javascript
'innerHTML'.pluralize() // 'InnerHTMLs'
'action_name'.pluralize() // 'actionNames'
'css-class-name'.pluralize() // 'cssClassNames'
'regex'.pluralize() // 'regexes'
'user'.pluralize() // 'users'
```
*/
export function pluralize(str: string): string {
return camelize(
[/([^aeiou])y$/, /()fe?$/, /([^aeiou]o|[sxz]|[cs]h)$/].map(
(c, i) => (str = str.replace(c, `$1${'iv'[i] || ''}e`))
) && str + 's'
);
}

export function group(name: string, group: string | undefined) {
return group ? `${group}/${name}` : name;
}
Expand Down
Loading