1
- import { ModelVar , OpExecutor , OpInputs , OpOutputs , AttrsData , BufferType , OpUniform } from '../commons/interface' ;
1
+ import {
2
+ ModelVar , Model , OpExecutor , OpInputs , OpOutputs ,
3
+ AttrsData , BufferType , OpUniform
4
+ } from '../commons/interface' ;
2
5
import { GLOBALS } from '../globals' ;
3
6
import Tensor from './tensor' ;
4
7
import opBehaviors from './opBehaviors' ;
@@ -21,14 +24,15 @@ export default class OpData {
21
24
outputTensors : Tensor [ ] = [ ] ;
22
25
fShaderParams : object [ ] = [ ] ;
23
26
vars : ModelVar [ ] = [ ] ;
27
+ dataLayout : string = '' ;
24
28
iLayer : number = 0 ;
25
29
program : string [ ] = [ ] ;
26
30
tensorData : ModelVar [ ] = [ ] ;
27
31
isFinalOp : boolean = false ;
28
32
modelName : string ;
29
33
bufferType : BufferType = BufferType . FrameBuffer ;
30
34
31
- constructor ( op : OpExecutor , iLayer : number , vars : ModelVar [ ] , isFinalOp : boolean , modelName : string ) {
35
+ constructor ( op : OpExecutor , iLayer : number , model : Model , isFinalOp : boolean , modelName : string ) {
32
36
const {
33
37
type,
34
38
inputs,
@@ -46,7 +50,8 @@ export default class OpData {
46
50
this . realName = type ;
47
51
this . isPackedOp = isPacked ;
48
52
this . bufferType = bufferType ;
49
- this . vars = vars ;
53
+ this . vars = model . vars ;
54
+ this . dataLayout = model . dataLayout || '' ;
50
55
this . iLayer = iLayer ;
51
56
this . isFinalOp = isFinalOp ;
52
57
this . input = inputs ;
@@ -221,7 +226,8 @@ export default class OpData {
221
226
interpType : data . interpType || 'NEAREST' ,
222
227
isPacked : this . isPackedOp || data . packed || false ,
223
228
binding : index ,
224
- noLayout : GLOBALS . backendInstance ?. noLayout
229
+ noLayout : GLOBALS . backendInstance ?. noLayout ,
230
+ dataLayout : this . dataLayout
225
231
} ) ;
226
232
if ( tensorName === 'out' ) {
227
233
this . outputTensors . push ( tensor ) ;
0 commit comments