Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Bug or Feature: directly assign 'true' to delay_alloc of Chunk rather than using input param delay_alloc_? #20343

Description

@ooooona

Description

I'm confuse about the coding here:

/*! \brief construct a new chunk */    
Chunk(mxnet::TShape shape, Context ctx_, bool delay_alloc_, int dtype)       
 : static_data(false), delay_alloc(true), ctx(ctx_),          
    storage_ref_(Storage::_GetSharedRef()),          
    engine_ref_(Engine::_GetSharedRef()) {      
  storage_shape = shape;      
  if (shape_is_known(storage_shape)) {        
    shandle.size = shape.Size() * mshadow::mshadow_sizeof(dtype);      
  } 
   var = Engine::Get()->NewVariable(); 
   shandle.ctx = ctx_; 
   if (!delay_alloc_) { 
     this->CheckAndAlloc(); 
   }
  }

here is source code

question

why not assign delay_alloc_ to delay_alloc?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions