File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,9 @@ class PatchImage {
1414 public:
1515 PatchImage () = default ;
1616
17- OrtxStatus Compute (const ortc::Tensor<float >& input, ortc::Tensor<float >& output) {
17+ OrtxStatus Compute (const ortc::Tensor<float >& input,
18+ ortc::Tensor<float >& output,
19+ ortc::Tensor<int64_t >& grid_thw_output) {
1820 // Validate and read HWC
1921 const auto & dims = input.Shape ();
2022 if (dims.size () != 3ULL ) {
@@ -59,6 +61,13 @@ class PatchImage {
5961 int64_t grid_h = H / patch_size_;
6062 int64_t grid_w = W / patch_size_;
6163
64+ // Populate grid_thw output tensor
65+ grid_thw_output.Allocate ({1 , 3 });
66+ int64_t * grid_data = const_cast <int64_t *>(grid_thw_output.Data ());
67+ grid_data[0 ] = grid_t ;
68+ grid_data[1 ] = grid_h;
69+ grid_data[2 ] = grid_w;
70+
6271 // Reshape dimensions (Python 9D)
6372 if (merge_size_ <= 0 ) {
6473 return {kOrtxErrorInvalidArgument , " [PatchImage]: merge_size must be > 0" };
You can’t perform that action at this time.
0 commit comments