Skip to content

Commit

Permalink
#13523: fix compilation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
o2buzzle committed Nov 2, 2024
1 parent 3960235 commit 4924301
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void validate(
TT_FATAL(tensor_args.input.buffer() != nullptr, "Expand: Input tensor need to be allocated in buffers on device");
if (output.has_value()) {
TT_FATAL(
output->get_shape().logical_shape().view() == operation_attributes.output_shape,
output->get_shape().logical_shape() == operation_attributes.output_shape,
"Expand: Output shape must match operation attributes");
TT_FATAL(input.get_layout() == output->get_layout(), "Expand: Input and output must have same layout");
TT_FATAL(input.get_dtype() == output->get_dtype(), "Expand: Input and output must have same dtype");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
//
// SPDX-License-Identifier: Apache-2.0

#pragma once

#include <cstdint>
#include <variant>
#include <vector>

#include "ttnn/decorators.hpp"
#include "ttnn/device_operation.hpp"
#include "ttnn/tensor/types.hpp"

namespace ttnn::operations::expand {
struct ExpandOperation {
Expand Down
8 changes: 3 additions & 5 deletions ttnn/cpp/ttnn/operations/data_movement/expand/expand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,12 @@ Tensor Expand::invoke(
// Convert tile tensor to row major (lmfao)
if (input.get_layout() == Layout::TILE) {
// untilize/tilize is way too inaccurate for us to even remotely use.
Tensor rm_input_dev = core::to_device(
tensor_impl::to_layout_wrapper(input.cpu(true), Layout::ROW_MAJOR), input.device(), std::nullopt);
Tensor rm_input_dev = core::to_device(input.cpu(true).to(Layout::ROW_MAJOR), input.device(), std::nullopt);

Tensor rm_output_dev = ttnn::prim::expand(rm_input_dev, output_shape, std::nullopt, std::nullopt);

return core::to_device(
tensor_impl::to_layout_wrapper(rm_output_dev.cpu(true).pad_to_tile(0), Layout::TILE),
rm_output_dev.device(),
std::nullopt);
rm_output_dev.cpu(true).pad_to_tile(0).to(Layout::TILE), rm_output_dev.device(), std::nullopt);
}

return ttnn::prim::expand(input, output_shape, output, memory_config);
Expand Down

0 comments on commit 4924301

Please sign in to comment.