File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ typedef struct {
5151 int numInputs = 0 ;
5252 int numOutputs = 0 ;
5353 int numInputArgs = 0 ;
54+ uint32_t scratchSize = 0 ;
5455 NeutronModelConfig mcfg;
5556 NeutronDataConfig dcfg;
5657 NeutronModelHandle nmh = NULL ;
@@ -194,6 +195,7 @@ class NeutronBackend final : public PyTorchBackendInterface {
194195 }
195196 uint32_t microcodeSize = buffer[6 ];
196197 uint32_t weightsSize = buffer[7 ];
198+ cfg->scratchSize = buffer[9 ];
197199 cfg->numInputs = buffer[11 ];
198200 cfg->numOutputs = buffer[12 ];
199201 if (cfg->numInputs != numInputs) {
@@ -236,7 +238,7 @@ class NeutronBackend final : public PyTorchBackendInterface {
236238 // Allocate place for input and output pointers.
237239 cfg->dcfg .inputs = static_cast <const void **>(context.allocate (cfg->numInputs * sizeof (void *)));
238240 cfg->dcfg .outputs = static_cast <void **>(context.allocate (cfg->numOutputs * sizeof (void *)));
239- cfg->dcfg .outputs [cfg->numOutputs ] = static_cast <void ** >(context.allocate (1 * sizeof ( void *) ));
241+ cfg->dcfg .outputs [cfg->numOutputs ] = static_cast <void *>(context.allocate (cfg-> scratchSize , 16 ));
240242
241243 // Set inputs from args.
242244 // Transpose inputs if needed.
You can’t perform that action at this time.
0 commit comments